Openbravo Issue Tracking System - Retail Modules
View Issue Details
0034045Retail ModulesWeb POSpublic2016-09-21 11:522016-10-10 11:30
aaroncalero 
mtaal 
urgentmajoralways
closedfixed 
5
 
 
migueldejuana
OBPS
Production - QA Approved
2016-05-19
RR16Q3
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/e7408dbbf027 [^]
No
0034045: 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.
depends on backport 0034080RR16Q3.2 closed mtaal The context argument of the OBPOS_PreOrderSave is no longer the OB.DATA instance 
causes defect 0033996 closed mtaal [STORE SERVER] Pay open tickets functionality is too poor. 
Issue History
2016-09-21 11:52aaroncaleroNew Issue
2016-09-21 11:52aaroncaleroAssigned To => Retail
2016-09-21 11:52aaroncaleroOBNetwork customer => Yes
2016-09-21 11:52aaroncaleroResolution time => 1475618400
2016-09-21 11:52aaroncaleroRegression level => Production - QA Approved
2016-09-21 11:52aaroncaleroRegression date => 2016-05-19
2016-09-21 11:52aaroncaleroRegression introduced in release => RR16Q3
2016-09-21 11:52aaroncaleroRegression introduced by commit => https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/e7408dbbf027 [^]
2016-09-21 11:52aaroncaleroTriggers an Emergency Pack => No
2016-09-21 12:28mtaalAssigned ToRetail => mtaal
2016-09-25 11:42mtaalStatusnew => scheduled
2016-09-25 11:48hgbotCheckin
2016-09-25 11:48hgbotNote Added: 0090225
2016-09-25 11:48hgbotStatusscheduled => resolved
2016-09-25 11:48hgbotResolutionopen => fixed
2016-09-25 11:48hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4996685e5e52681cd5b9211659a75dd0375d7b2c [^]
2016-09-25 11:51mtaalRelationship addedcauses 0033996
2016-09-25 11:54mtaalReview Assigned To => migueldejuana
2016-10-10 11:30migueldejuanaNote Added: 0090514
2016-10-10 11:30migueldejuanaStatusresolved => closed

Notes
(0090225)
hgbot   
2016-09-25 11:48   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 4996685e5e52681cd5b9211659a75dd0375d7b2c
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Sep 25 11:46:09 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4996685e5e52681cd5b9211659a75dd0375d7b2c [^]

Fixes issue 34045: The context argument of the OBPOS_PreOrderSave is no longer the OB.DATA instance
Pass in the context argument to be used within the inner functions

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---
(0090514)
migueldejuana   
2016-10-10 11:30   
Tested and reviewed