Openbravo Issue Tracking System - Retail Modules
View Issue Details
0037211Retail ModulesStoreServerpublic2017-11-02 16:022017-11-29 10:39
AugustoMauch 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
 
migueldejuana
No
0037211: OBRECP_ComplementaryProduct is not being exported/synchronized properly
OBRECP_ComplementaryProduct is a child table of m_product, and it is used to associate a product with other products, so that when a product is buyed, other products are offered to buy as complementary products.

The records of that table are stored in the organization of the main product. But the router needs to also take into account the organization of the complementary products, to avoid synchronizing to a store a row where the complementary product does not exist.
Suppose there are three products:
- One global product (defined in *)
- Two local products (defined in two different child organizations, say X and Y).

Suppose there is a store server defined for organiation X.

If the product defined in Y is added as a complementary for the global product, that record (defined in *) will be synchronized to the store that has access to X, even though it does not have access to the products defined in Y. This will lead to a synchronization error.
Take into account the organization of the complementary product when exporting/synchronizing records of OBRECP_ComplementaryProduct
No tags attached.
Issue History
2017-11-02 16:02AugustoMauchNew Issue
2017-11-02 16:02AugustoMauchAssigned To => AugustoMauch
2017-11-02 16:02AugustoMauchTriggers an Emergency Pack => No
2017-11-02 16:07hgbotCheckin
2017-11-02 16:07hgbotNote Added: 0100220
2017-11-02 16:07hgbotStatusnew => resolved
2017-11-02 16:07hgbotResolutionopen => fixed
2017-11-02 16:07hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization.but/rev/d4c17cc6374137e0e2b2f41e9cb8a61b128a4291 [^]
2017-11-07 22:30mtaalReview Assigned To => mtaal
2017-11-20 11:36mtaalNote Added: 0100614
2017-11-25 15:49mtaalNote Added: 0100711
2017-11-25 15:49mtaalStatusresolved => new
2017-11-25 15:49mtaalResolutionfixed => open
2017-11-25 15:51mtaalReview Assigned Tomtaal => AugustoMauch
2017-11-25 15:51hgbotCheckin
2017-11-25 15:51hgbotNote Added: 0100712
2017-11-25 15:51hgbotStatusnew => resolved
2017-11-25 15:51hgbotResolutionopen => fixed
2017-11-25 15:51hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization.but/rev/d4c17cc6374137e0e2b2f41e9cb8a61b128a4291 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization.but/rev/fa52b2def398c610c280709c7f39187c94977a4d [^]
2017-11-25 15:52mtaalNote Added: 0100713
2017-11-27 10:19mtaalReview Assigned ToAugustoMauch => migueldejuana
2017-11-29 10:39migueldejuanaNote Added: 0100805
2017-11-29 10:39migueldejuanaStatusresolved => closed

Notes
(0100220)
hgbot   
2017-11-02 16:07   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization.but
Changeset: d4c17cc6374137e0e2b2f41e9cb8a61b128a4291
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Nov 02 16:04:43 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization.but/rev/d4c17cc6374137e0e2b2f41e9cb8a61b128a4291 [^]

Fixes issue 37211: OBRECP_ComplementaryProduct is properly routed

Now when synchronizing/routing records of the OBRECP_ComplementaryProduct table, the organization of the complementary product is also taken into account.

This helps prevent synchronization errors when a local product is added to a global product.

---
M src-db/database/sourcedata/AD_DATASET_TABLE.xml
M src-db/database/sourcedata/STRSYNC_CUSTOM_ROUTER.xml
M src-db/database/sourcedata/STRSYNC_SYNCHRONIZEDTABLE.xml
A src/org/openbravo/retail/storeserver/synchronization/but/router/ComplementaryProductRouter.java
---
(0100614)
mtaal   
2017-11-20 11:36   
While reviewing and testing I found a bug (afaics) in the dataset store export query change. The query does 'm_product_id in'. While I think it should do 'm_product_complementary_id in'

I found this because the complementary product record was not exported if the comp-product has a different org than the parent product. It should be exported if both orgs are fine for the store being exported.
(0100711)
mtaal   
2017-11-25 15:49   
A change is needed in the dataset query, pushing the change and set back for reclosing by original author
(0100712)
hgbot   
2017-11-25 15:51   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization.but
Changeset: fa52b2def398c610c280709c7f39187c94977a4d
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sat Nov 25 15:50:57 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization.but/rev/fa52b2def398c610c280709c7f39187c94977a4d [^]

Fixes issue 37211: OBRECP_ComplementaryProduct is not being exported/synchronized properly
Check for the child product, the complementary product if it is in the org of the store. The parent/main product is already checked in the query.

---
M src-db/database/sourcedata/AD_DATASET_TABLE.xml
---
(0100713)
mtaal   
2017-11-25 15:52   
Except for the additional change I propose, the rest of the changes look fine and work correctly
(0100805)
migueldejuana   
2017-11-29 10:39   
Reviewed