Openbravo Issue Tracking System - Retail Modules
View Issue Details
0037204Retail ModulesStoreServerpublic2017-10-31 18:102017-12-13 22:18
AugustoMauch 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
 
mtaal
No
0037204: Anonymous customer and its location should be excluded for orgs not in natural org tree
When exporting a store, the anonymous customer and the customer location of the organizations that are not part of the natural organization tree of the store being exported should be excluded.
-
No tags attached.
causes defect 0037353 closed AugustoMauch EM_OBRETCO_RETAILORGTYPE column for orgs not in natural tree dataset should be excluded 
Issue History
2017-10-31 18:10AugustoMauchNew Issue
2017-10-31 18:10AugustoMauchAssigned To => AugustoMauch
2017-10-31 18:10AugustoMauchTriggers an Emergency Pack => No
2017-10-31 18:22hgbotCheckin
2017-10-31 18:22hgbotNote Added: 0100201
2017-10-31 18:22hgbotStatusnew => resolved
2017-10-31 18:22hgbotResolutionopen => fixed
2017-10-31 18:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/b384f4e2564ef09dd2bd2ca61a611d1600f66913 [^]
2017-11-07 22:27mtaalReview Assigned To => mtaal
2017-11-25 13:54mtaalNote Added: 0100708
2017-11-25 13:54mtaalStatusresolved => new
2017-11-25 13:54mtaalResolutionfixed => open
2017-11-25 14:55mtaalNote Added: 0100710
2017-11-27 11:29mtaalAssigned ToAugustoMauch => mtaal
2017-11-28 12:06hgbotCheckin
2017-11-28 12:06hgbotNote Added: 0100782
2017-11-28 12:07mtaalAssigned Tomtaal => AugustoMauch
2017-11-30 11:29mtaalRelationship addedcauses 0037353
2017-12-13 15:20hgbotCheckin
2017-12-13 15:20hgbotNote Added: 0101015
2017-12-13 15:20hgbotStatusnew => resolved
2017-12-13 15:20hgbotResolutionopen => fixed
2017-12-13 15:20hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/b384f4e2564ef09dd2bd2ca61a611d1600f66913 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/83f73488abc97cb62861dd2fb137e08ab1f994c1 [^]
2017-12-13 22:18mtaalNote Added: 0101025
2017-12-13 22:18mtaalStatusresolved => closed

Notes
(0100201)
hgbot   
2017-10-31 18:22   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: b384f4e2564ef09dd2bd2ca61a611d1600f66913
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Oct 31 18:22:09 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/b384f4e2564ef09dd2bd2ca61a611d1600f66913 [^]

Fixes issue 37204: Business partner and its location is excluded from some orgs

The columns EM_Obretco_C_bp_Location_ID and EM_Obretco_C_Bpartner_ID will be excluded of the store data for those organizations that are not part of the organization natural tree of the store being exported.

---
M src-db/database/sourcedata/AD_DATASET_COLUMN.xml
---
(0100708)
mtaal   
2017-11-25 13:54   
Hi,
I tested this and I see several things. I exported a store and installed, this went fine. However when doing smartbuild I get the exception below [1]

I was testing with a version installed earlier but with latest source code. So the anon-bp was already exported. When I did changes at runtime to the organization which was not in the store-org-tree. I created a new BP (non-standard). I set it to be the anon-bp of the org. The changes still got synchronized to the store. This because the BP was changed to a non-standard BP by this [2] eventhandler.

So I am not sure if this change in the dataset is really needed. What issue is being resolved here?

[1]
     [java] 22581 WARN - SQL Command failed with: ERROR: check constraint "em_obretco_org_pos_chk" is violated by some row
     [java] 22586 WARN - -- END
     [java] ALTER TABLE AD_ORG
     [java] ADD CONSTRAINT EM_OBRETCO_ORG_POS_CHK CHECK (EM_OBRETCO_RETAILORGTYPE = 'S' AND EM_OBRETCO_C_BPARTNER_ID IS NOT NULL AND EM_OBRETCO_C_BP_LOCATION_ID IS NOT NULL OR EM_OBRETCO_RETAILORGTYPE <> 'S')

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/file/tip/src/org/openbravo/retail/storeserver/synchronization/eventhandler/OrganizationEventHandlerForStandardCustomerFlag.java [^]
(0100710)
mtaal   
2017-11-25 14:55   
Note: this constraint also fails in case of a BUT instance but then already in install.source
(0100782)
hgbot   
2017-11-28 12:06   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: a2b31f3a67aca03f2b1d5beebfd7a373900acdcc
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Nov 28 12:06:36 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/a2b31f3a67aca03f2b1d5beebfd7a373900acdcc [^]

Related to issue 37204: Anonymous customer and its location should be excluded for orgs not in natural org tree
Backed out changeset b384f4e2564e

---
M src-db/database/sourcedata/AD_DATASET_COLUMN.xml
---
(0101015)
hgbot   
2017-12-13 15:20   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 83f73488abc97cb62861dd2fb137e08ab1f994c1
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Dec 13 15:20:34 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/83f73488abc97cb62861dd2fb137e08ab1f994c1 [^]

Fixes issue 37204, fixes issue 37353: Excludes columns from ad_org

The following columns are excluded from ad_org for those orgs not included in the org natural tree of the store being exported:
- EM_Obretco_C_Bpartner_ID
- EM_Obretco_C_bp_Location_ID
- EM_OBRETCO_RETAILORGTYPE

This way, the EM_OBRETCO_ORG_POS_CHK constraint is no longer working when installing the new store.

---
M src-db/database/sourcedata/AD_DATASET_COLUMN.xml
---
(0101025)
mtaal   
2017-12-13 22:18   
Reviewed