Openbravo Issue Tracking System - Retail Modules
View Issue Details
0051547Retail ModulesRetail APIpublic2023-02-09 10:332023-02-16 13:28
nicola_uva 
caristu 
immediatemajorhave not tried
closedfixed 
5
pi 
pi 
No
0051547: PriceList API - Product price is wrongly added when same products searchKey on different Orgs are in OB backoffice
Product price is wrongly added when same products searchKey on different Orgs are in defined OB backoffice. (see step to reproduce)
1) Configure in the backoffice 2 products with same searchkey and different orgs
1.1) product search key 123, name "Product 1" org *
1.2) product search key 123, name "Product 2", org "Vall Blanca Store"
2) Execute a call to the "PriceList" API endpoint, to create a price for a pricelist defined in "Vall Blanca Store", for the product with search key "123"
3) In the backoffice the product price is added to the product "Product 1", on * organization
4) error-> product price must added to the Product 2 in organization "Vall Blanca", which is the one closer in the natural organization tree.
No tags attached.
related to defect 0048780 closed caristu Retail Modules It is not possible to create or modify a product if there exist 2 product categories with the same searchkey 
related to defect 0051553pi closed vmromanos Retail Modules Inventory API - When we have 2 products same searckey on different organization, we cannot do an inventory 
related to defect 0051628 closed caristu Modules OSP.getBOBInClosestOrg should return null when no bob is found in the natural tree of the organization 
txt priceListRequest.txt (534) 2023-02-09 10:55
https://issues.openbravo.com/file_download.php?file_id=18105&type=bug
Issue History
2023-02-09 10:33nicola_uvaNew Issue
2023-02-09 10:33nicola_uvaAssigned To => caristu
2023-02-09 10:33nicola_uvaFile Added: priceListRequest.txt
2023-02-09 10:33nicola_uvaTriggers an Emergency Pack => No
2023-02-09 10:54marvintmSummaryPriceList API - Product price is wrong added when same products searchKey on different Orgs are in OB backoffice => PriceList API - Product price is wrongly added when same products searchKey on different Orgs are in OB backoffice
2023-02-09 10:54marvintmDescription Updatedbug_revision_view_page.php?rev_id=25506#r25506
2023-02-09 10:54marvintmSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25508#r25508
2023-02-09 10:55marvintmFile Deleted: priceListRequest.txt
2023-02-09 10:55marvintmFile Added: priceListRequest.txt
2023-02-09 10:57marvintmSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25509#r25509
2023-02-09 10:58marvintmSeveritycritical => major
2023-02-09 11:00alostaleRelationship addedrelated to 0048780
2023-02-09 12:56hgbotNote Added: 0146309
2023-02-09 17:33vmromanosRelationship addedrelated to 0051553
2023-02-10 10:15hgbotNote Added: 0146355
2023-02-10 10:44hgbotNote Added: 0146358
2023-02-10 11:01hgbotNote Added: 0146360
2023-02-10 11:01hgbotNote Added: 0146361
2023-02-10 11:04hgbotNote Added: 0146362
2023-02-10 11:04hgbotResolutionopen => fixed
2023-02-10 11:04hgbotStatusnew => closed
2023-02-10 11:04hgbotNote Added: 0146363
2023-02-10 11:08hgbotNote Added: 0146364
2023-02-10 11:08hgbotNote Added: 0146365
2023-02-10 11:20hgbotNote Added: 0146366
2023-02-10 14:26hgbotNote Added: 0146387
2023-02-10 14:46hgbotNote Added: 0146389
2023-02-10 14:46hgbotNote Added: 0146390
2023-02-10 15:02hgbotNote Added: 0146392
2023-02-16 13:28caristuIssue cloned0051628
2023-02-16 13:28caristuRelationship addedrelated to 0051628

Notes
(0146309)
hgbot   
2023-02-09 12:56   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.service.external.integration/-/merge_requests/31 [^]
(0146355)
hgbot   
2023-02-10 10:15   
Merge Request created: https://gitlab.com/openbravo/ci/modules/org.openbravo.service.external.integration.tests/-/merge_requests/18 [^]
(0146358)
hgbot   
2023-02-10 10:44   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/821 [^]
(0146360)
hgbot   
2023-02-10 11:01   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: b81166bc38a888fdf6e043d0bbd1fedc7c632bf8
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 10-02-2023 10:01:02
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/b81166bc38a888fdf6e043d0bbd1fedc7c632bf8 [^]

related to BUG-51547: OSP method to retrieve from a collection the BOB closest to an org

---
M src/org/openbravo/dal/security/OrganizationStructureProvider.java
---
(0146361)
hgbot   
2023-02-10 11:01   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/821 [^]
(0146362)
hgbot   
2023-02-10 11:04   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.service.external.integration/-/merge_requests/31 [^]
(0146363)
hgbot   
2023-02-10 11:04   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.service.external.integration [^]
Changeset: c6ed6a3c628aa7dddee9a6833891a2e4c85e94b7
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 10-02-2023 10:47:06
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.service.external.integration/-/commit/c6ed6a3c628aa7dddee9a6833891a2e4c85e94b7 [^]

fixes BUG-51547: the expected referenced record is not found in some cases

When we have two referenced records with match with the searching
criteria, the selected record was being taken in an arbitrary way. Now
we take into account the organization of the parent record to retrieve
the "closest" record, with the following criteria:

1- First we take the closest record in the parent list, if multiple
records are found then we sort them by ID and return the first one.
2- If no records are found at the first step, then we select the record
whose organization is present in the child tree. Here it does not make
sense to consider the distance, because we can have multiple records
with the same distance due to the ramifications that the child tree may
have. If multiple records are found, then we sort them by ID and return
the first one.
3- If still we have not selected any record after these two steps,
which may be the case of the cross organization references, then we just
sort the candidate records by its ID and return the first one.

---
M src/org/openbravo/service/external/integration/mapping/DirectPropertyMapping.java
---
(0146364)
hgbot   
2023-02-10 11:08   
Repository: https://gitlab.com/openbravo/ci/modules/org.openbravo.service.external.integration.tests [^]
Changeset: 45506f7d7f2009e04a7fd00026e40f504d43c5e2
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 10-02-2023 10:08:11
URL: https://gitlab.com/openbravo/ci/modules/org.openbravo.service.external.integration.tests/-/commit/45506f7d7f2009e04a7fd00026e40f504d43c5e2 [^]

related to BUG-51547: add test case

---
M src-db/database/sourcedata/OBEI_ENTITY_MAPPING.xml
M src-db/database/sourcedata/OBEI_PROP_MAP_INSTANCE.xml
M src-test/org/openbravo/service/external/integration/test/_import/PriceListImportTest.java
---
(0146365)
hgbot   
2023-02-10 11:08   
Merge request merged: https://gitlab.com/openbravo/ci/modules/org.openbravo.service.external.integration.tests/-/merge_requests/18 [^]
(0146366)
hgbot   
2023-02-10 11:20   
Repository: https://gitlab.com/openbravo/ci/modules/org.openbravo.service.external.integration.tests [^]
Changeset: a8296b0b667b30fd0a736c91e88dce74a6849f25
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 10-02-2023 11:19:53
URL: https://gitlab.com/openbravo/ci/modules/org.openbravo.service.external.integration.tests/-/commit/a8296b0b667b30fd0a736c91e88dce74a6849f25 [^]

related to BUG-51547: use better variable name

---
M src-test/org/openbravo/service/external/integration/test/_import/PriceListImportTest.java
---
(0146387)
hgbot   
2023-02-10 14:26   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/823 [^]
(0146389)
hgbot   
2023-02-10 14:46   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: d77665f0baaaa46c24d58799f264af20b74adb33
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 10-02-2023 14:24:53
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/d77665f0baaaa46c24d58799f264af20b74adb33 [^]

related to ISSUE-51547: makes use of generics in OSP API

---
M src/org/openbravo/dal/security/OrganizationStructureProvider.java
---
(0146390)
hgbot   
2023-02-10 14:46   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/823 [^]
(0146392)
hgbot   
2023-02-10 15:02   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 5861ec21d7ec657adc136f1eac594c07d6b3ca3a
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 10-02-2023 15:01:49
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/5861ec21d7ec657adc136f1eac594c07d6b3ca3a [^]

related to ISSUE-51547: javadoc improvements

---
M src/org/openbravo/dal/security/OrganizationStructureProvider.java
---