Openbravo Issue Tracking System - Retail Modules
View Issue Details
0040664Retail ModulesStoreServerpublic2019-04-24 09:372019-05-15 23:22
AugustoMauch 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
 
mtaal
No
0040664: Allow the specify the column to use in the GenericBusinessPartnerSegmentationEventHandler to select the business partner
The GenericBusinessPartnerSegmentationEventHandler is an event handler that acts upon the tables defined in the OBSTSYN_AUTO_ADD_BP_STORE table.

It takes the c_bpartner_id column of those tables, and adds that business partner to the stores with access to the organization selected in other column.

In some cases, the column that references the c_bpartner table is not named c_bpartner_id, so a new column should be added to the OBSTSYN_AUTO_ADD_BP_STORE table to allow selecting it.

It should be possible to specify in the Auto Add Business Partner to Store Tables window the column to use in the event handler
-
No tags attached.
related to feature request 0039114 closed AugustoMauch Provide a convenient way to automatically add a business partner to a store when referenced from a transactional table 
blocks defect 0040495 closed AugustoMauch Synchronization error when the c_orderline.em_obrcifp_c_bp_location_id column is filled 
Issue History
2019-04-24 09:37AugustoMauchNew Issue
2019-04-24 09:37AugustoMauchAssigned To => AugustoMauch
2019-04-24 09:37AugustoMauchTriggers an Emergency Pack => No
2019-04-24 09:37AugustoMauchRelationship addedrelated to 0039114
2019-04-24 10:45hgbotCheckin
2019-04-24 10:45hgbotNote Added: 0111256
2019-04-24 10:45hgbotStatusnew => resolved
2019-04-24 10:45hgbotResolutionopen => fixed
2019-04-24 10:45hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/216622970772d6b8f2f128256697b56fdc342662 [^]
2019-04-24 10:47AugustoMauchReview Assigned To => mtaal
2019-04-24 10:47AugustoMauchRelationship addedblocks 0040495
2019-05-06 16:58mtaalNote Added: 0111509
2019-05-06 17:15mtaalNote Added: 0111511
2019-05-06 17:15mtaalStatusresolved => new
2019-05-06 17:15mtaalResolutionfixed => open
2019-05-15 10:18hgbotCheckin
2019-05-15 10:18hgbotNote Added: 0111688
2019-05-15 10:18hgbotStatusnew => resolved
2019-05-15 10:18hgbotResolutionopen => fixed
2019-05-15 10:18hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/216622970772d6b8f2f128256697b56fdc342662 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/08301e57ffa58fd5d7f9ef6a09555ae9a782f297 [^]
2019-05-15 23:22mtaalNote Added: 0111695
2019-05-15 23:22mtaalStatusresolved => closed

Notes
(0111256)
hgbot   
2019-04-24 10:45   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 216622970772d6b8f2f128256697b56fdc342662
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Apr 24 10:44:27 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/216622970772d6b8f2f128256697b56fdc342662 [^]

Fixes issue 40664: It is possible to specify c_bpartner_id column in OBSTSYN_AUTO_ADD_BP_STORE

Before this changeset, the GenericBusinessPartnerSegmentationEventHandler always picked a column
name c_bpartner_id on the target table. Now it is possible to pick the column that will be used
to select the referenced business partner. If this column is not filled in, c_bpartner_id will
be used by default.

---
M src-db/database/model/tables/OBSTSYN_AUTO_ADD_BP_STORE.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/GenericBusinessPartnerSegmentationEventHandler.java
---
(0111509)
mtaal   
2019-05-06 16:58   
Some comments/questions:
- I am not sure on the thread safety of the global static Maps, should maybe the initialization method be set to be synchronized?
- Should the initialization of the map [1] not be outside of the for loop?
- I would rename orgProperty here to bpProperty

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/file/216622970772/src/org/openbravo/retail/storeserver/synchronization/eventhandler/GenericBusinessPartnerSegmentationEventHandler.java#l101 [^]

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/file/216622970772/src/org/openbravo/retail/storeserver/synchronization/eventhandler/GenericBusinessPartnerSegmentationEventHandler.java#l105 [^]
(0111511)
mtaal   
2019-05-06 17:15   
See comments
(0111688)
hgbot   
2019-05-15 10:18   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 08301e57ffa58fd5d7f9ef6a09555ae9a782f297
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed May 15 10:18:52 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/08301e57ffa58fd5d7f9ef6a09555ae9a782f297 [^]

Fixes issue 40664: Applies code review commentes:

- Variable orgProperty has been renamed to bpProperty
- Initialization of map nonDefaultBusinessPartnerProperties was wrong, not it is placed outside a loop
- Initialization method getEntitiesThatAddAutomaticallBusinessPartnerToStore is now synchronized

---
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/GenericBusinessPartnerSegmentationEventHandler.java
---
(0111695)
mtaal   
2019-05-15 23:22   
reviewed and tested