Openbravo Issue Tracking System - Retail Modules
View Issue Details
0033372Retail ModulesWeb POSpublic2016-06-28 14:182016-07-08 13:06
umartirena 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
 
RR16Q4 
guilleaer
No
0033372: [SERQA 1372] Pay Open Tickets process raises an error if implements an asincronous hook
[SERQA 1372] Pay Open Tickets process raises an error if implements an asincronous hook.

This issue happens because the Pay Open Ticket process tries to save in local database the same ticket twice. It happens when there is asynchronous code while saving the tickets.
Log In Web POS:

Open Web Developers tool and execute the following code:

OB.UTIL.HookManager.registerHook('OBPOS_PreOrderSave', function(args, callback){

setTimeout(function(){
OB.UTIL.HookManager.callbackExecutor(args,callback);
}, 15000)

})

Go back to Web POS:

 * Add a product to the a ticket for a Certain Business Partner
 * Click on Layaway this receipt
 * Go to Payments window
 * Click on Layaway
 * Create another ticket.
 * Add a product to the a ticket for a Certain Business Partner
 * Click on Layaway this receipt
 * Go to Payments window
 * Click on Layaway
 * Go to menu and click on Pay Open Tickets
 * Select the two previous layaways
 * Pay the layaways completely
 * Click on Done

Realize that the following error is raise in Console:

3cc22d6…_WebPOS.js:2761 [checkBlocked][no-transaction][hasbeenpaid_is_yes] Wrong write in c_order avoided [40A5909F166510BAC034F947F1EED447][VBS1/0000169] - Caller: https://livebuilds.openbravo.com/retail_pi_pgsql/web/js/gen/3cc22d6f95942f203853ccd5e952ee33_WebPOS.js:32037:18 [^] - callerInfo:
Object.OB.Dal.save (https://livebuilds.openbravo.com/retail_pi_pgsql/web/js/gen/3cc22d6f95942f203853ccd5e952ee33_WebPOS.js:4248:22 [^]);
https://livebuilds.openbravo.com/retail_pi_pgsql/web/js/gen/3cc22d6f95942f203853ccd5e952ee33_WebPOS.js:32037:18; [^]
callbackExecutor (https://livebuilds.openbravo.com/retail_pi_pgsql/web/js/gen/3cc22d6f95942f203853ccd5e952ee33_WebPOS.js:11365:7 [^]);
<anonymous>:4:21; line: https://livebuilds.openbravo.com/retail_pi_pgsql/web/js/gen/3cc22d6f95942f203853ccd5e952ee33_WebPOS.js:4488:22 [^] (*,+)
Find patch attached
SER-QA
diff issue.diff (4,427) 2016-06-28 17:58
https://issues.openbravo.com/file_download.php?file_id=9594&type=bug
Issue History
2016-06-28 14:18umartirenaNew Issue
2016-06-28 14:18umartirenaAssigned To => Retail
2016-06-28 14:18umartirenaResolution time => 1468015200
2016-06-28 14:18umartirenaTriggers an Emergency Pack => No
2016-06-28 14:18umartirenaTag Attached: SER-QA
2016-06-28 17:58umartirenaFile Added: issue.diff
2016-06-28 17:58umartirenaProposed Solution updated
2016-06-29 14:42ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2016-06-29 14:42ranjith_qualiantech_comStatusnew => scheduled
2016-07-02 07:51hgbotCheckin
2016-07-02 07:51hgbotNote Added: 0088162
2016-07-02 07:51hgbotStatusscheduled => resolved
2016-07-02 07:51hgbotResolutionopen => fixed
2016-07-02 07:51hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/154016f60410d1665f4f3512ab24b5d63ce8e570 [^]
2016-07-02 07:51hgbotCheckin
2016-07-02 07:51hgbotNote Added: 0088163
2016-07-08 13:06guilleaerReview Assigned To => guilleaer
2016-07-08 13:06guilleaerStatusresolved => closed
2016-07-08 13:06guilleaerFixed in Version => RR16Q4

Notes
(0088162)
hgbot   
2016-07-02 07:51   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 154016f60410d1665f4f3512ab24b5d63ce8e570
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Sat Jul 02 11:20:36 2016 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/154016f60410d1665f4f3512ab24b5d63ce8e570 [^]

Fixes issue 33372 : Changes in order save to support asynchronous save operation

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---
(0088163)
hgbot   
2016-07-02 07:51   
Repository: tools/automation/pi-mobile
Changeset: 3d244c956baaaedf426115276952ebd2be194473
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Sat Jul 02 11:20:33 2016 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/3d244c956baaaedf426115276952ebd2be194473 [^]

Verifies issue 33372 : Added automated test 'I33372_VerifySaveReceiptWithCustomeHook'

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I33372_VerifySaveReceiptWithCustomeHook.java
---