Openbravo Issue Tracking System - Retail Modules
View Issue Details
0034080Retail ModulesWeb POSpublic2016-09-21 11:522016-09-27 09:48
aaroncalero 
mtaal 
urgentmajoralways
closedfixed 
5
 
RR16Q3.2RR16Q3.2 
guilleaer
OBPS
Production - QA Approved
2016-05-19
RR16Q3
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/e7408dbbf027 [^]
No
0034080: The context argument of the OBPOS_PreOrderSave is no longer the OB.DATA instance
When the OBPOS_PreOrderSave hook is invoked, its args parameter contains three arguments: the context of the execution, the model representing the pos object, and the receipt.
The refactor to allow synchronous transactions moved the body of the body of the onclose functions to separate functions. This has caused the scope of these functions to be the window object instead of the OB.DATA instance (the former 'this').
Because of this, now the context argument during the execution of the OBPOS_PreOrderSave hooks is window, instead of the OB.DATA instance.
Login in a 16Q2 web pos instance, set a breakpoint on the execution of the OBPOS_PreOrderSave hook, complete a ticket to trigger the breakpoint, and verify that the value of the 'this' variable equals the OB.DATA object.

Now login in a 16Q3 or a pi and repeat the same process. Verify that now the 'this' variable equals the window object.
One posibility is to create the mainReceiptCloseFunction and multiOrdersFunction as members of the OB.DATA object (instead of creating them as vars). This way we ensure that the context of these functions during its execution is OB.DATA.
No tags attached.
blocks defect 0034045 closed mtaal The context argument of the OBPOS_PreOrderSave is no longer the OB.DATA instance 
Issue History
2016-09-25 11:42mtaalTypedefect => backport
2016-09-25 11:42mtaalTarget Version => RR16Q3.3
2016-09-25 12:17mtaalReview Assigned To => migueldejuana
2016-09-25 12:17mtaalTarget VersionRR16Q3.3 => RR16Q3.2
2016-09-25 14:42hgbotCheckin
2016-09-25 14:42hgbotNote Added: 0090233
2016-09-25 14:42hgbotStatusscheduled => resolved
2016-09-25 14:42hgbotResolutionopen => fixed
2016-09-25 14:42hgbotFixed in SCM revision => http://code.openbravo.com/retail/backports/3.0RR16Q3.2/org.openbravo.retail.posterminal/rev/e6cb165d85e83f7e646ca473ac146838235a2a96 [^]
2016-09-27 09:48guilleaerReview Assigned Tomigueldejuana => guilleaer
2016-09-27 09:48guilleaerStatusresolved => closed
2016-09-27 09:48guilleaerFixed in Version => RR16Q3.2

Notes
(0090233)
hgbot   
2016-09-25 14:42   
Repository: retail/backports/3.0RR16Q3.2/org.openbravo.retail.posterminal
Changeset: e6cb165d85e83f7e646ca473ac146838235a2a96
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Sep 25 14:41:18 2016 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR16Q3.2/org.openbravo.retail.posterminal/rev/e6cb165d85e83f7e646ca473ac146838235a2a96 [^]

Fixes issue 34080: The context argument of the OBPOS_PreOrderSave is no longer the OB.DATA instance
Pass the context to the inner functions

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