Openbravo Issue Tracking System - Retail Modules
View Issue Details
0039228Retail ModulesWeb POSpublic2018-09-05 12:202018-10-18 16:38
marvintm 
migueldejuana 
urgentmajorrandom
closedfixed 
5
 
 
marvintm
No
0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed
Currently the receipt object is global, accessible by different asynchronous processes, and therefore as the process to complete the receipt is asynchronous, it is possible that modifications happen after the user has confirmed that the ticket should be processed.

It is not possible to avoid the execution of parallel asynchronous processes. However, it is possible to avoid that the execution of these processes changes the information of the current receipt, by cloning the information of the ticket synchronously when the ticket completion process starts, so that from that point on, the cloned ticket is used to execute the completion process.
Due to the nature of the issue, the main problems it causes are only visible randomly in different ways. An example of an issue caused indirectly by this problem is the following:

https://issues.openbravo.com/view.php?id=39219 [^]
- Ticket should be cloned in a synchronized way at the start of the ticket completion process.
- The clone of the ticket should be used by the remaining actions in the ticket completion process.
- Even though the WebSQL database could in theory be a problem as it is another global point shared by all processes, so another process could save, and therefore overwrite the ticket with incorrect or outdated information in theory, in practice this should no longer be possible due to the implementation of the "hasbeenmodified" check while saving the record, which should prevent this problem from happening.
No tags attached.
related to defect 0039219 closed migueldejuana Order is imported without lines if Supr is pressed more than once after Done is launched 
depends on backport 0039393RR18Q3.2 closed migueldejuana Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed 
depends on backport 0039484RR18Q2.4 closed migueldejuana Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed 
related to defect 0038862 closed migueldejuana Ticket completion should be executed fully inside the same database transaction 
related to defect 0041067 closed migueldejuana Cash management object is global and therefore can be modified after the user has confirmed that the ticket should be processed 
diff mobileCore17q2.diff (6,451) 2018-10-18 10:30
https://issues.openbravo.com/file_download.php?file_id=12282&type=bug
diff mobileCore17Q33.diff (10,822) 2018-10-18 10:30
https://issues.openbravo.com/file_download.php?file_id=12283&type=bug
diff posterminal17q2.diff (18,856) 2018-10-18 10:30
https://issues.openbravo.com/file_download.php?file_id=12284&type=bug
diff posterminal17Q33.diff (23,825) 2018-10-18 10:30
https://issues.openbravo.com/file_download.php?file_id=12285&type=bug
Issue History
2018-09-05 12:20marvintmNew Issue
2018-09-05 12:20marvintmAssigned To => Retail
2018-09-05 12:20marvintmTriggers an Emergency Pack => No
2018-09-05 13:38ngarciaIssue Monitored: ngarcia
2018-09-05 13:45rafarodaIssue Monitored: rafaroda
2018-09-05 13:46rafarodaRelationship addedrelated to 0038862
2018-09-05 13:46rafarodaRelationship addedrelated to 0039219
2018-09-22 12:22hgbotCheckin
2018-09-22 12:22hgbotNote Added: 0106945
2018-09-22 12:22hgbotStatusnew => resolved
2018-09-22 12:22hgbotResolutionopen => fixed
2018-09-22 12:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.certification.france/rev/a7ea20a0029d388fec5512a62311c76fe5cea1f3 [^]
2018-09-24 11:44hgbotCheckin
2018-09-24 11:44hgbotNote Added: 0106955
2018-09-24 11:44hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.certification.france/rev/a7ea20a0029d388fec5512a62311c76fe5cea1f3 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.certification.france/rev/3502cba26576595e7c7b18416bfc89a86979f334 [^]
2018-09-24 11:44hgbotCheckin
2018-09-24 11:44hgbotNote Added: 0106956
2018-09-24 11:44hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.certification.france/rev/3502cba26576595e7c7b18416bfc89a86979f334 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.certification.france.testing/rev/8eb582e6320f09f83b3edf62e3535dc7c94a31ae [^]
2018-09-24 12:56marvintmAssigned ToRetail => migueldejuana
2018-09-25 11:25hgbotCheckin
2018-09-25 11:25hgbotNote Added: 0106998
2018-09-25 11:25hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.certification.france.testing/rev/8eb582e6320f09f83b3edf62e3535dc7c94a31ae [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6910f55260f8b13d080357ae85a428873df444aa [^]
2018-09-25 11:25hgbotCheckin
2018-09-25 11:25hgbotNote Added: 0107000
2018-09-25 11:25hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6910f55260f8b13d080357ae85a428873df444aa [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c8bfb5a83a52b30c5bf5e0d1496f83f48b97a5f5 [^]
2018-09-25 11:25hgbotCheckin
2018-09-25 11:25hgbotNote Added: 0107001
2018-09-25 11:25hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c8bfb5a83a52b30c5bf5e0d1496f83f48b97a5f5 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/937b88dcb5907541cfb6842ab982750408c486ea [^]
2018-09-25 11:25hgbotCheckin
2018-09-25 11:25hgbotNote Added: 0107002
2018-09-25 11:25hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/937b88dcb5907541cfb6842ab982750408c486ea [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/21b7af32d1dd83a9371ee2974641e61f61333cca [^]
2018-09-25 11:25hgbotCheckin
2018-09-25 11:25hgbotNote Added: 0107003
2018-09-25 11:25hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/21b7af32d1dd83a9371ee2974641e61f61333cca [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/bbd60d8feedd6d60e12885322de6f91eac948e9d [^]
2018-09-25 11:25hgbotCheckin
2018-09-25 11:25hgbotNote Added: 0107004
2018-09-25 11:25hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/bbd60d8feedd6d60e12885322de6f91eac948e9d [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/a8ea661c6af12b28c46df3a464c0396ac5b4e41a [^]
2018-09-25 11:25hgbotCheckin
2018-09-25 11:25hgbotNote Added: 0107005
2018-09-25 11:25hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/a8ea661c6af12b28c46df3a464c0396ac5b4e41a [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/57d2a0c4bc8515edcf7470a121683274de8402f3 [^]
2018-09-25 11:25hgbotCheckin
2018-09-25 11:25hgbotNote Added: 0107006
2018-09-25 11:25hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/57d2a0c4bc8515edcf7470a121683274de8402f3 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1c4983d51309bddac5c9d47917e65e49fad9051d [^]
2018-09-27 10:38hgbotCheckin
2018-09-27 10:38hgbotNote Added: 0107045
2018-09-27 10:38hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1c4983d51309bddac5c9d47917e65e49fad9051d [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.stockvalidation/rev/dcd5184888e81af6d66d9c76e656c0642c37d1d2 [^]
2018-09-28 13:18marvintmNote Added: 0107071
2018-09-28 13:18marvintmStatusresolved => new
2018-09-28 13:18marvintmResolutionfixed => open
2018-09-28 14:09hgbotCheckin
2018-09-28 14:09hgbotNote Added: 0107073
2018-09-28 14:09hgbotStatusnew => resolved
2018-09-28 14:09hgbotResolutionopen => fixed
2018-09-28 14:09hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.stockvalidation/rev/dcd5184888e81af6d66d9c76e656c0642c37d1d2 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/cfb6a93c38e8961d10cd7364d1337287a255a182 [^]
2018-09-28 14:47marvintmReview Assigned To => marvintm
2018-09-28 14:47marvintmStatusresolved => closed
2018-09-28 14:47marvintmFixed in Version => RR18Q4
2018-10-03 09:26migueldejuanaStatusclosed => new
2018-10-03 09:26migueldejuanaResolutionfixed => open
2018-10-03 09:26migueldejuanaFixed in VersionRR18Q4 =>
2018-10-03 09:26migueldejuanaStatusnew => scheduled
2018-10-03 09:26migueldejuanaStatusscheduled => resolved
2018-10-03 09:26migueldejuanaResolutionopen => fixed
2018-10-03 09:26migueldejuanaStatusresolved => closed
2018-10-18 10:30migueldejuanaFile Added: mobileCore17q2.diff
2018-10-18 10:30migueldejuanaFile Added: mobileCore17Q33.diff
2018-10-18 10:30migueldejuanaFile Added: posterminal17q2.diff
2018-10-18 10:30migueldejuanaFile Added: posterminal17Q33.diff
2018-10-18 10:31migueldejuanaFile Added: posterminal18Q24.diff
2018-10-18 10:31migueldejuanaFile Added: mobileCore18Q24.diff
2018-10-18 16:37migueldejuanaStatusclosed => new
2018-10-18 16:37migueldejuanaResolutionfixed => open
2018-10-18 16:37migueldejuanaStatusnew => scheduled
2018-10-18 16:37migueldejuanaStatusscheduled => resolved
2018-10-18 16:37migueldejuanaResolutionopen => fixed
2018-10-18 16:38migueldejuanaStatusresolved => closed
2018-10-19 13:27migueldejuanaFile Deleted: mobileCore18Q24.diff
2018-10-19 13:27migueldejuanaFile Deleted: posterminal18Q24.diff
2019-06-11 10:01migueldejuanaRelationship addedrelated to 0041067

Notes
(0106945)
hgbot   
2018-09-22 12:22   
Repository: erp/pmods/org.openbravo.certification.france
Changeset: a7ea20a0029d388fec5512a62311c76fe5cea1f3
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Sat Sep 22 12:18:11 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.certification.france/rev/a7ea20a0029d388fec5512a62311c76fe5cea1f3 [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

- Mark the order to do not be saved in local database

---
M web/org.openbravo.certification.france/js/ticket/preOrderSaveFinishCancelLayawayHook.js
---
(0106955)
hgbot   
2018-09-24 11:44   
Repository: erp/pmods/org.openbravo.certification.france
Changeset: 3502cba26576595e7c7b18416bfc89a86979f334
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Sep 24 11:43:56 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.certification.france/rev/3502cba26576595e7c7b18416bfc89a86979f334 [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

- Update hash

---
M src-db/database/sourcedata/AD_MODULE.xml
---
(0106956)
hgbot   
2018-09-24 11:44   
Repository: erp/pmods/org.openbravo.certification.france.testing
Changeset: 8eb582e6320f09f83b3edf62e3535dc7c94a31ae
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Sep 24 11:44:23 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.certification.france.testing/rev/8eb582e6320f09f83b3edf62e3535dc7c94a31ae [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

- Update hash

---
M src-test/org/openbravo/certification/france/testing/blockchain/test/OBCFRiModuleVerification.java
---
(0106998)
hgbot   
2018-09-25 11:25   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 6910f55260f8b13d080357ae85a428873df444aa
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Wed Sep 19 13:25:48 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6910f55260f8b13d080357ae85a428873df444aa [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

- Instead of do a get and then an update, do directly and update checking the column hasbeenpaid instead of the json.

---
M web/org.openbravo.mobile.core/source/data/ob-dal.js
---
(0107000)
hgbot   
2018-09-25 11:25   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: c8bfb5a83a52b30c5bf5e0d1496f83f48b97a5f5
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Wed Sep 19 13:26:56 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c8bfb5a83a52b30c5bf5e0d1496f83f48b97a5f5 [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

- Remove unnedeed save after the order is frozen

---
M web/org.openbravo.retail.posterminal/js/utils/ticketCloseUtils.js
---
(0107001)
hgbot   
2018-09-25 11:25   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 937b88dcb5907541cfb6842ab982750408c486ea
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Wed Sep 19 17:52:49 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/937b88dcb5907541cfb6842ab982750408c486ea [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

- Freeze the receipt to avoid overridding the object before sending it to the backend.
- Keep the diff validation (diffReceipt)
- Do a clearWith with frozenReceipt over receipt to set al values and launch all changes events
- Launch triggers over receipt to launch listeners

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
M web/org.openbravo.retail.posterminal/js/utils/ticketCloseUtils.js
---
(0107002)
hgbot   
2018-09-25 11:25   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 21b7af32d1dd83a9371ee2974641e61f61333cca
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Sat Sep 22 12:16:01 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/21b7af32d1dd83a9371ee2974641e61f61333cca [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

- Do the clearWith of the frozenReceipt before creating next order
- Save before in the code in Multiorders Layaways coming from server
- Do not save locally quotations and cancel orders

---
M web/org.openbravo.retail.posterminal/js/components/modalmultiorders.js
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/pointofsale.js
---
(0107003)
hgbot   
2018-09-25 11:25   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: bbd60d8feedd6d60e12885322de6f91eac948e9d
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Sep 24 12:00:43 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/bbd60d8feedd6d60e12885322de6f91eac948e9d [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

- Do not save frozenReceiptif hasbeenpaid='Y'

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---
(0107004)
hgbot   
2018-09-25 11:25   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: a8ea661c6af12b28c46df3a464c0396ac5b4e41a
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Sep 24 17:10:21 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/a8ea661c6af12b28c46df3a464c0396ac5b4e41a [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

. Set again diffReceipt with the frozenReceipt

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---
(0107005)
hgbot   
2018-09-25 11:25   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 57d2a0c4bc8515edcf7470a121683274de8402f3
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Tue Sep 25 08:42:00 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/57d2a0c4bc8515edcf7470a121683274de8402f3 [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

- Remove empty line

---
M web/org.openbravo.retail.posterminal/js/utils/ticketCloseUtils.js
---
(0107006)
hgbot   
2018-09-25 11:25   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 1c4983d51309bddac5c9d47917e65e49fad9051d
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Tue Sep 25 09:28:02 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1c4983d51309bddac5c9d47917e65e49fad9051d [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

- Do not save frozenReceipt after sync it

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---
(0107045)
hgbot   
2018-09-27 10:38   
Repository: erp/pmods/org.openbravo.retail.stockvalidation
Changeset: dcd5184888e81af6d66d9c76e656c0642c37d1d2
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Sep 27 10:37:47 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.stockvalidation/rev/dcd5184888e81af6d66d9c76e656c0642c37d1d2 [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

- We do a clearWith using frozenReceipt and this launches again stockvalidation. Avoid this

---
M web/org.openbravo.retail.stockvalidation/js/modals.js
---
(0107071)
marvintm   
2018-09-28 13:18   
There is a problem in synchronized mode, hasbeenpaid remains as 'Y' if request to OrderLoader fails with error, which means that the ticket cannot be completed anyore.
(0107073)
hgbot   
2018-09-28 14:09   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: cfb6a93c38e8961d10cd7364d1337287a255a182
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Fri Sep 28 14:09:03 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/cfb6a93c38e8961d10cd7364d1337287a255a182 [^]

Fixed issue 0039228: Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed

- Restore receipt, frozenReceipt is just to send it to the server

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---