Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036036Retail ModulesStoreServerpublic2017-05-18 11:022017-06-23 11:14
mtaal 
mtaal 
normalminorhave not tried
closedfixed 
5
 
RR17Q3RR17Q3 
AugustoMauch
No
0036036: When BP is created in the store then the store-Business-Partner relation is not created in central when Store goes to online
When a store is offline a BP can be created in the store or can be used in an order. In both cases the BP-store relation has to be updated/created in the central server.

This currently does not happen for when the store is a secondary store.

See transcript of chat session (attached) for details.
Run multi-server
Put central down, store goes offline
Create a BP in the store, set default store to Store1, flag as standard BP
Create a ticket for the BP in the store
Put central up again
Ticket and Bp get replicated but no BP-store relation is created
Add a writerfilteradapter which listens to bpartner writes to central and creates the store-bp relations where needed.

Exclude the default store column from being replicated to store or central. Recompute the info all the time in central
No tags attached.
? chat session (6,200) 2017-05-18 11:03
https://issues.openbravo.com/file_download.php?file_id=10771&type=bug
Issue History
2017-05-18 11:02mtaalNew Issue
2017-05-18 11:02mtaalAssigned To => mtaal
2017-05-18 11:02mtaalTriggers an Emergency Pack => No
2017-05-18 11:03mtaalFile Added: chat session
2017-05-22 12:18hgbotCheckin
2017-05-22 12:18hgbotNote Added: 0096704
2017-05-22 12:18hgbotStatusnew => resolved
2017-05-22 12:18hgbotResolutionopen => fixed
2017-05-22 12:18hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/c11bd40e2aff45be5deb7ea7c794aa13aaeb592d [^]
2017-05-22 12:19mtaalReview Assigned To => AugustoMauch
2017-05-22 17:30AugustoMauchNote Added: 0096721
2017-05-22 17:30AugustoMauchStatusresolved => new
2017-05-22 17:30AugustoMauchResolutionfixed => open
2017-06-06 23:05mtaalSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15296#r15296
2017-06-06 23:06hgbotCheckin
2017-06-06 23:06hgbotNote Added: 0097174
2017-06-06 23:06hgbotStatusnew => resolved
2017-06-06 23:06hgbotResolutionopen => fixed
2017-06-06 23:06hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/c11bd40e2aff45be5deb7ea7c794aa13aaeb592d [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/d678475e4ce9e3af65f6328ea4636abad953e660 [^]
2017-06-06 23:06mtaalNote Added: 0097175
2017-06-06 23:45mtaalNote Edited: 0097175bug_revision_view_page.php?bugnote_id=0097175#r15298
2017-06-06 23:48mtaalSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15299#r15299
2017-06-06 23:48mtaalProposed Solution updated
2017-06-06 23:48mtaalNote Edited: 0097175bug_revision_view_page.php?bugnote_id=0097175#r15300
2017-06-06 23:48mtaalStatusresolved => new
2017-06-06 23:48mtaalResolutionfixed => open
2017-06-07 00:24mtaalNote Added: 0097177
2017-06-07 00:28hgbotCheckin
2017-06-07 00:28hgbotNote Added: 0097178
2017-06-07 00:28hgbotStatusnew => resolved
2017-06-07 00:28hgbotResolutionopen => fixed
2017-06-07 00:28hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/d678475e4ce9e3af65f6328ea4636abad953e660 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/08cd4d0acc2de76be76b5ff106450bfbd640096c [^]
2017-06-07 00:28hgbotCheckin
2017-06-07 00:28hgbotNote Added: 0097179
2017-06-15 18:30hgbotCheckin
2017-06-15 18:30hgbotNote Added: 0097424
2017-06-23 11:14AugustoMauchNote Added: 0097605
2017-06-23 11:14AugustoMauchStatusresolved => closed
2017-06-23 11:14AugustoMauchFixed in Version => RR17Q3

Notes
(0096704)
hgbot   
2017-05-22 12:18   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: c11bd40e2aff45be5deb7ea7c794aa13aaeb592d
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Mon May 22 12:18:29 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/c11bd40e2aff45be5deb7ea7c794aa13aaeb592d [^]

Fixes issue 36036: When BP is created in the store then the store-Business-Partner relation is not created in central when Store goes to online
Create secondary synchronization relation in store server which gets replicated to the central server, on central server catch the
replication and create either primary or allow secondary relation if does not yet exist.
Added synchronized table to sync bp-store table from store to central.

---
M src-db/database/sourcedata/STRSYNC_SYNCHRONIZEDTABLE.xml
M src/org/openbravo/retail/storeserver/synchronization/VersionCacheResetWriterFilterAdapter.java
M src/org/openbravo/retail/storeserver/synchronization/utils/BusinessPartnerSegmentationUtils.java
A src/org/openbravo/retail/storeserver/synchronization/BPartnerStoreWriterFilterAdapter.java
---
(0096721)
AugustoMauch   
2017-05-22 17:30   
Reopened because it is not possible to reproduce it with the steps given
(0097174)
hgbot   
2017-06-06 23:06   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: d678475e4ce9e3af65f6328ea4636abad953e660
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Jun 06 23:06:06 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/d678475e4ce9e3af65f6328ea4636abad953e660 [^]

Fixes issue 36036: When BP is created in the store then the store-Business-Partner relation is not created in central when Store goes to online
Also compute the BP store relations in the store server

---
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/OrderEventHandler.java
---
(0097175)
mtaal   
2017-06-06 23:06   
(edited on: 2017-06-06 23:48)
Changed the approach. Is much simpler, if a bpartner is created/updated in a store server and then replicated to central then we must assume that the BPartner should be linked to that store also. So then create the needed BP-store relations on write in central.

Is simpler and does not require to sync the bpartner-store relation, only do some additional actions when syncing a bpartner to central (which does not happen often, only in offline mode).

Adapted the description of the issue.

Reverted part of previous commits.

(0097177)
mtaal   
2017-06-07 00:24   
Test scenario:
- create BP in the store
- check that it gets replicated to central and that the default store is set
- then change the default store in central to something else (not-null)
- update the BP in the store by changing the tax id
- check that in central an additional store-BP relation is created
- then remove that relation in central and clear the default store in the BP in central
- update the BP in the store by changing the tax id
- check that in central the default store is set
(0097178)
hgbot   
2017-06-07 00:28   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 08cd4d0acc2de76be76b5ff106450bfbd640096c
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Jun 07 00:26:09 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/08cd4d0acc2de76be76b5ff106450bfbd640096c [^]

Fixes issue 36036: When BP is created in the store then the store-Business-Partner relation is not created in central when Store goes to online
Create the BP-store relation in central whenever a BP is created/changed/updated within the store

---
M src-db/database/sourcedata/STRSYNC_EXCLUDEDCOL.xml
M src-db/database/sourcedata/STRSYNC_SYNCHRONIZEDTABLE.xml
M src/org/openbravo/retail/storeserver/synchronization/BPartnerStoreWriterFilterAdapter.java
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/OrderEventHandler.java
M src/org/openbravo/retail/storeserver/synchronization/utils/BusinessPartnerSegmentationUtils.java
---
(0097179)
hgbot   
2017-06-07 00:28   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 15dcded8c52b24193c66e5ac2469132bb49b86d2
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Jun 07 00:28:14 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/15dcded8c52b24193c66e5ac2469132bb49b86d2 [^]

Related to issue 36036: When BP is created in the store then the store-Business-Partner relation is not created in central when Store goes to online
Only exclude the default store from store to central

---
M src-db/database/sourcedata/STRSYNC_EXCLUDEDCOL.xml
---
(0097424)
hgbot   
2017-06-15 18:30   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: bb7e2091aed300f29bbdd5b823aca014fbb68505
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Jun 15 18:29:15 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/bb7e2091aed300f29bbdd5b823aca014fbb68505 [^]

Related with issue 36036: If business partner does not exist, continue

If there is no business partner with the given ID, just continue. Without this change, a query would be done that would result in no business partner being updated. If we know that in advance, better not make the query.

---
M src/org/openbravo/retail/storeserver/synchronization/BPartnerStoreWriterFilterAdapter.java
---
(0097605)
AugustoMauch   
2017-06-23 11:14   
Code reviewed and verified