Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0039484
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Retail Modules] Web POSmajorrandom2018-09-05 12:202018-10-22 18:22
ReportermarvintmView Statuspublic 
Assigned Tomigueldejuana 
PriorityurgentResolutionfixedFixed in VersionRR18Q2.4
StatusclosedFix in branchFixed in SCM revisiona8e9b7bee676
ProjectionnoneETAnoneTarget VersionRR18Q2.4
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarvintm
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

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

DescriptionCurrently 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.
Steps To ReproduceDue 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 [^]
Proposed Solution- 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.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks design defect 0039228 closedmigueldejuana Receipt object is global and therefore can be modified after the user has confirmed that the ticket should be processed 

-  Notes
(0107443)
hgbot (developer)
2018-10-18 16:39

Repository: retail/backports/3.0RR18Q2.4/org.openbravo.retail.posterminal
Changeset: 4bd1252aaf5cc92472330fd06d9edb50b24e7493
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Oct 18 16:39:39 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.retail.posterminal/rev/4bd1252aaf5cc92472330fd06d9edb50b24e7493 [^]

Fixed issue 0039484: 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
- 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
- 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
- Do not save frozenReceiptif hasbeenpaid='Y'
. Set again diffReceipt with the frozenReceipt
- Do not save frozenReceipt after sync it
- Restore receipt, frozenReceipt is just to send it to the server

---
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
M web/org.openbravo.retail.posterminal/js/utils/ticketCloseUtils.js
---
(0107444)
hgbot (developer)
2018-10-18 16:40

Repository: retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core
Changeset: 3fe5a7f31139bb3c52394b997f63f353ff45cd9a
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Oct 18 16:38:49 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/3fe5a7f31139bb3c52394b997f63f353ff45cd9a [^]

Fixed issue 0039484: 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
---
(0107460)
hgbot (developer)
2018-10-19 13:23

Repository: retail/backports/3.0RR18Q2.4/org.openbravo.retail.posterminal
Changeset: 21b906eba0f56ee7fe9b1353938ee55cdddb5164
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Fri Oct 19 13:23:11 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.retail.posterminal/rev/21b906eba0f56ee7fe9b1353938ee55cdddb5164 [^]

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

- Use frozenReceipt instead of receipt

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---
(0107477)
hgbot (developer)
2018-10-22 13:10

Repository: erp/pmods/org.openbravo.retail.stockvalidation
Changeset: a8e9b7bee676af55bdb236e980b63932e2553a39
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/a8e9b7bee676af55bdb236e980b63932e2553a39 [^]

Fixed issue 39484: 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
---

- Issue History
Date Modified Username Field Change
2018-10-18 16:37 migueldejuana Type design defect => backport
2018-10-18 16:37 migueldejuana Target Version => RR18Q2.4
2018-10-18 16:39 hgbot Checkin
2018-10-18 16:39 hgbot Note Added: 0107443
2018-10-18 16:39 hgbot Status scheduled => resolved
2018-10-18 16:39 hgbot Resolution open => fixed
2018-10-18 16:39 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/cfb6a93c38e8961d10cd7364d1337287a255a182 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.retail.posterminal/rev/4bd1252aaf5cc92472330fd06d9edb50b24e7493 [^]
2018-10-18 16:40 hgbot Checkin
2018-10-18 16:40 hgbot Note Added: 0107444
2018-10-18 16:40 hgbot Fixed in SCM revision http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.retail.posterminal/rev/4bd1252aaf5cc92472330fd06d9edb50b24e7493 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/3fe5a7f31139bb3c52394b997f63f353ff45cd9a [^]
2018-10-19 13:23 hgbot Checkin
2018-10-19 13:23 hgbot Note Added: 0107460
2018-10-19 13:23 hgbot Fixed in SCM revision http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/3fe5a7f31139bb3c52394b997f63f353ff45cd9a [^] => http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.retail.posterminal/rev/21b906eba0f56ee7fe9b1353938ee55cdddb5164 [^]
2018-10-19 13:41 marvintm Status resolved => closed
2018-10-19 13:41 marvintm Fixed in Version => RR18Q2.4
2018-10-22 13:10 hgbot Checkin
2018-10-22 13:10 hgbot Note Added: 0107477
2018-10-22 13:10 hgbot Status closed => resolved
2018-10-22 13:10 hgbot Fixed in SCM revision http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.retail.posterminal/rev/21b906eba0f56ee7fe9b1353938ee55cdddb5164 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.stockvalidation/rev/a8e9b7bee676af55bdb236e980b63932e2553a39 [^]
2018-10-22 18:22 marvintm Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker