Notes |
|
(0086635)
|
AugustoMauch
|
2016-05-22 20:52
(edited on: 2016-05-22 20:53) |
|
Changes done to a business partner will be synchronized to a store if any of these conditions are met:
- The business partner has been explicitely included in a store. The Business Partner by Server window stores the relation between business partners and stores.
- The business partner is NOT flagged as Standard Store Customer. The sales representatives and the business partners that are the default business partners of the organizations should not have that flag checked
|
|
|
|
|
|
(0087018)
|
mtaal
|
2016-06-06 10:23
(edited on: 2016-06-06 10:24) |
|
Comments:
- check the connection usage/closing in the new routers as the new routers seem to use DAL and DAL connection which are not closed
- the simple_customer column is not updated when new user/bp is created, additional event handlers are needed
- two warnings in the code related to not-used log-member
|
|
|
(0087087)
|
hgbot
|
2016-06-08 11:14
|
|
|
|
(0087088)
|
hgbot
|
2016-06-08 11:14
|
|
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 2713ab5f69993948044d4b0e952530430d031fd5
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jun 07 18:35:25 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/2713ab5f69993948044d4b0e952530430d031fd5 [^]
Related with issue 32252: Routers take into account Standard Customer flag
The Is Standard Store Customer flag will be checked for those business partners that are not standard customers (i.e. they are also sales representatives or the default business
partner of a store). When one of these business partners change, all the store servers should receive these changes. This was already taken into account in the dataset table wher
e clause, but not in the routers.
---
M src/org/openbravo/retail/storeserver/synchronization/router/BusinessPartnerLocationRouter.java
M src/org/openbravo/retail/storeserver/synchronization/router/BusinessPartnerRouter.java
M src/org/openbravo/retail/storeserver/synchronization/router/LocationRouter.java
---
|
|
|
(0087092)
|
hgbot
|
2016-06-08 13:12
|
|
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: c0b9b39f8e9c88d61501206b1a346dd1a8dc7f5c
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Jun 08 13:09:57 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/c0b9b39f8e9c88d61501206b1a346dd1a8dc7f5c [^]
Related with issue 32252: Prevents leaving the DAL connection open
There was a risk of leaving DAL connections open if routers implementations used DAL but forgot to close the connection. This has now been prevented by committing and closing the connection in AbstractClientFilteredRouter (a superclass of all routers defined in OB) after invoking doRouteToNodes (which is implemented by router implementations).
---
M src/org/openbravo/replication/symmetricds/extensions/AbstractClientFilteredRouter.java
---
|
|
|
(0087101)
|
hgbot
|
2016-06-08 18:06
|
|
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: c24bbe2a056e68cd75d409d25b7228337691d79f
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Jun 08 18:04:13 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/c24bbe2a056e68cd75d409d25b7228337691d79f [^]
Fixes issue 32252: Adds event handler to keep Is Standard Customer flag updated
The value of the BusinessPartner.IsStandardCustomer flag will be false if one of these conditions are met:
- The business partner is a sales representative
- The business partner is used as the default business partner of a store (organization)
- The business partner is related to an OrganizationInfo
An event handler has been added to each one of these tables to update this flag automatically. The event handlers only set the flag to false and never back to true, because if a business partner has not been a standard customer at one point, it will remain like that from then on.
---
A src/org/openbravo/retail/storeserver/synchronization/eventhandler/BusinessPartnerEventHandlerForStandardCustomerFlag.java
A src/org/openbravo/retail/storeserver/synchronization/eventhandler/OrganizationEventHandlerForStandardCustomerFlag.java
A src/org/openbravo/retail/storeserver/synchronization/eventhandler/OrganizationInfoEventHandlerForStandardCustomerFlag.java
---
|
|
|
|
When a 'Is Standard Customer' flag of a business partner is set to false, that business partner, along with its related tables, need to be synchronized to all servers. |
|
|
(0087140)
|
hgbot
|
2016-06-09 17:21
|
|
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 4f0612e986ca7f8f52e02d87af9a855967c1d738
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Jun 09 17:04:55 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/4f0612e986ca7f8f52e02d87af9a855967c1d738 [^]
Related with bug 32252: Change how the business partner router gets flag value
The Is Standard Customer flag of c_bpartner is used to route business partners: if its value is false the business partner will be sent to all store servers, otherwise it will only be sent to the stores the business partner belongs to.
The router used to take the flag value from the metadata, that is the value it had in the database when the trigger captured the change. This was a problem in an event handler that "touched" the c_bpartner tables and the related ones when the flag was updated from true to false. The tables were touched inside the eventhandler, which is executed before actually commiting the change to the database, and the wrong value (true) was being used in the router. This resulted in referencial integrity errors.
To prevent this, the router will no longer take the value from the metada but from the database itself. It requires an extra query, but it is done using an indexed column so the performance is hardly affected.
---
M src/org/openbravo/retail/storeserver/synchronization/router/BusinessPartnerRouter.java
---
|
|
|
(0087141)
|
hgbot
|
2016-06-09 17:21
|
|
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 9c221c39d9bb08f53ed13219a8e795d78193086d
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Jun 09 17:17:54 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/9c221c39d9bb08f53ed13219a8e795d78193086d [^]
Related with bug 32252: Refactors logic to touch c_bpartner and related tables
The logic, which used to be in the BusinessPartnerPerStoreEventHandler has been moved to its own class (BusinessPartnerAndRelatedTablesSynchronizer) because it is going to be needed in other classes.
---
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/BusinessPartnerPerStoreEventHandler.java
A src/org/openbravo/retail/storeserver/synchronization/process/BusinessPartnerAndRelatedTablesSynchronizer.java
---
|
|
|
(0087142)
|
hgbot
|
2016-06-09 17:21
|
|
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 74c4bf8b6a2446621be179afa34e9ce139a72dd4
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Jun 09 17:19:15 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/74c4bf8b6a2446621be179afa34e9ce139a72dd4 [^]
Related with issue 32252: Touch c_bpartner tables if flag is set to false
Adds an event handler that will use the BusinessPartnerAndRelatedTablesSynchronizer class to touch the c_bpartner table and its related tables when the Is Standard Customer flag of c_bpartner is changed from false to true.
---
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/BusinessPartnerEventHandlerForStandardCustomerFlag.java
---
|
|
|
(0087678)
|
mtaal
|
2016-06-20 15:35
|
|
|
|
(0087680)
|
mtaal
|
2016-06-20 15:45
|
|
|
|
(0087784)
|
hgbot
|
2016-06-22 11:06
|
|
|
|
(0087785)
|
hgbot
|
2016-06-22 11:07
|
|
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 60eb421ee7849caafc339ebc13e4878f8237cbc0
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Jun 22 11:04:54 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/60eb421ee7849caafc339ebc13e4878f8237cbc0 [^]
Related with issue 32252: Fixes some of the problems found in the code review
The default values in the Business Partners by Store subtab are now calculated problem. There was a javascript error because the business partner (which acts as parent field) field was not defined in that tab. Also the tab level of that tab has been fixed.
The OrderEventHandler event handler is not executed if:
- The server is a store server
- The business partner is a non standard customer (those are synched to all store servers, no need to add them to the business partner by store table)
The client and organization of the new record are taken from the order.
---
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_TAB.xml
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/OrderEventHandler.java
---
|
|
|
|
Code review items #1, #3 and #5 are pending to be fixed |
|
|
(0089097)
|
mtaal
|
2016-08-15 12:16
|
|
#5 has been done, see issue 33535 |
|
|
(0089167)
|
hgbot
|
2016-08-17 09:19
|
|
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: c67137c57a5211d4080683fe5ed1fa400997a683
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Aug 15 11:35:44 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/c67137c57a5211d4080683fe5ed1fa400997a683 [^]
Related with issue 32252: Adds Default Store field to Business Partner
This field will be used in addition to the obstsyn_server_bpartner table to specify the stores where a business partner is a customer. Before this changeset all this info was stored in the obstsyn_server_bpartner, but given that most of the business partner will buy from only one store, it makes sense to include that info in the c_bpartner table itself.
---
M src-db/database/model/modifiedTables/C_BPARTNER.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
---
|
|
|
(0089173)
|
hgbot
|
2016-08-17 10:55
(edited on: 2016-08-17 10:56) |
|
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: edacffe523c3efd267703d17784dd0494e0d1cd4
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Aug 17 10:48:13 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/edacffe523c3efd267703d17784dd0494e0d1cd4 [^]
Related with issue 32252: Adds default store column to c_bpartner
Most business partners will buy only from one store. It will have better performance to include the default store in the c_bpartner location than having to create a new record for that business partner and that store in the obstsyn_server_bpartner. This change results not only in a big reduction in the volume on obstsyn_server_bpartner, but also on a big performance improvement in the queries related to business partner segmentation.
---
M src-db/database/sourcedata/AD_DATASET_TABLE.xml
M src/org/openbravo/retail/storeserver/synchronization/StoreBusinessPartnerLoaderHook.java
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/OrderEventHandler.java
M src/org/openbravo/retail/storeserver/synchronization/router/BusinessPartnerLocationRouter.java
M src/org/openbravo/retail/storeserver/synchronization/router/BusinessPartnerRouter.java
M src/org/openbravo/retail/storeserver/synchronization/router/LocationRouter.java
A src/org/openbravo/retail/storeserver/synchronization/utils/BusinessPartnerSegmentationUtils.java
---
|
|
|
(0090524)
|
mtaal
|
2016-10-11 10:52
|
|
Point #1 is open to be done |
|
|
|
|
|
(0091043)
|
hgbot
|
2016-11-01 23:37
|
|
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 817e856e0a8fd9942bbbde50a8189982059375f2
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Nov 01 23:37:07 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/817e856e0a8fd9942bbbde50a8189982059375f2 [^]
Related to issue 32252: Store Server Data Segmentation and Sync for BP
Linking the BPartner to the store needs a OrderLoaderHook as the event handler
is not executing because the triggers are not enabled.
---
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/OrderEventHandler.java
---
|
|
|
(0091044)
|
mtaal
|
2016-11-01 23:38
|
|
Previous changesets have been reviewed, last commit should be reviewed by separate developer |
|
|
|
Code reviewed and verified |
|