Openbravo Issue Tracking System - Retail Modules
View Issue Details
0038573Retail ModulesWeb POSpublic2018-05-17 17:572018-06-21 09:32
asiermartirena 
asiermartirena 
normalmajorhave not tried
closedfixed 
5
 
RR18Q3 
marvintm
No
No
0038573: The save action of the ticket is being executed more times that should
The save action of the order model is being executed locally in Web POS more times that it should, causing performance problems.

When updating a line quantity, a save action is done and then the calculateReceipt process is executed, which also finishes with a save action. The second save is the only necessary (and correct) one.

When introducing many lines at a time, or when doing several changes in the ticket that launches many calculateReceipt processes, the save action is also executed 2 times, when it should be executed only after the last calculate receipt.

Also, when the deleting lines process finishes, a save action is executed in addition to the calculateReceipt action. In this case, the last save action is correct, but the calculateReceipt save action must be avoided.

In the other hand, when loading receipts to the Web POS, the order is not being saved locally at the end of the process, which is an error, because if the user presses the F5 having that order, the ticket status is incorrect.
Load the Web POS. Introduce multiple lines -> Multiple save actions

Change the quantity of some line -> Multiple save actions

Delete a line -> Multiple save actions

Load a ticket -> The ticket is not save fully, so if the user presses F5, is visible that the ticket is corrupted
No tags attached.
causes defect 0038825 closed jorge-garcia Order not saved in WebSQL if the customer is changed while the first product is being added. 
Issue History
2018-05-17 17:57asiermartirenaNew Issue
2018-05-17 17:57asiermartirenaAssigned To => asiermartirena
2018-05-17 17:57asiermartirenaOBNetwork customer => No
2018-05-17 17:57asiermartirenaTriggers an Emergency Pack => No
2018-05-21 09:06hgbotCheckin
2018-05-21 09:06hgbotNote Added: 0104595
2018-05-21 09:06hgbotStatusnew => resolved
2018-05-21 09:06hgbotResolutionopen => fixed
2018-05-21 09:06hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/69f7c826e00458e543be9280089778be37479ac2 [^]
2018-05-21 15:34asiermartirenaDescription Updatedbug_revision_view_page.php?rev_id=17165#r17165
2018-06-21 09:32marvintmReview Assigned To => marvintm
2018-06-21 09:32marvintmStatusresolved => closed
2018-06-21 09:32marvintmFixed in Version => RR18Q3
2018-06-25 15:36aaroncaleroRelationship addedcauses 0038825

Notes
(0104595)
hgbot   
2018-05-21 09:06   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 69f7c826e00458e543be9280089778be37479ac2
Author: Asier Martirena <asier.martirena <at> openbravo.com>
Date: Fri May 18 10:10:38 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/69f7c826e00458e543be9280089778be37479ac2 [^]

Fixed issue 38573: The save action of the ticket is being executed more times that should

When doing the save action in a calculateReceipt function, now the save is only done if there are no pending calculateReceipt processes.
When modifying the line quantity, the save action is no directly called now, is called from the calculateReceipt action that is executed when setting a new quantity.
In the delete lines process, now the save action is not executed when doing the calculateReceipt, because is called after that. In this flow, is necessary to call it later. Also, to finish the delete lines process the Web POS was waiting for the save action, now the action is launched but the user can continue without waiting for the response.
The calculateGrossAndSave funtion is sent with the true parameter when loading a receipt, otherwise the ticket is not correctly stored in the Web SQL, causing problems if an user presses the F5 having the ticket loaded.

---
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/utils/orderSelectorUtils.js
---