Openbravo Issue Tracking System - Retail Modules
View Issue Details
0028102Retail ModulesWeb POSpublic2014-11-05 21:512014-12-01 18:50
jecharri 
mario_castello 
urgentmajoralways
closedfixed 
5
 
RR15Q1RR15Q1 
malsasua
No
0028102: Hook OBPOS_PreOrderSave is not working fine if you cancel the save process
Hook OBPOS_PreOrderSave is not working fine if you cancel the save process

-Create a hook using OBPOS_PreOrderSave
-Change the value of property "cancellation" to true
-After the hook is executed verify that orders is still in the screen but it is not really loaded. For example if you execute a refresh you will see that order is not longer in the screen

The following code should not be executed before the confirmation of the hook:
OB.UTIL.updateDocumentSequenceInDB(docno);

      delete this.receipt.attributes.json;
      this.receipt.set('timezoneOffset', creationDate.getTimezoneOffset());
      this.receipt.set('created', creationDate.getTime());
      this.receipt.set('obposCreatedabsolute', OB.I18N.formatDateISO(creationDate)); // Absolute date in ISO format
      // The order will not be processed if the navigator is offline
      if (OB.POS.modelterminal.get('connectedToERP')) {
        this.receipt.set('isbeingprocessed', 'Y');
      }
No tags attached.
related to defect 0028272RR14Q4 closed malsasua hook pre_ordersave is not cancelling the save of the order 
related to defect 0029572 closed egoitz The EditCashupReport hook does not cancel the execution when receving the parameter args.cancellation = true 
Issue History
2014-11-05 21:51jecharriNew Issue
2014-11-05 21:51jecharriAssigned To => marvintm
2014-11-05 21:51jecharriResolution time => 1417906800
2014-11-05 21:51jecharriTriggers an Emergency Pack => No
2014-11-15 18:35hgbotCheckin
2014-11-15 18:35hgbotNote Added: 0071666
2014-11-15 18:35hgbotStatusnew => resolved
2014-11-15 18:35hgbotResolutionopen => fixed
2014-11-15 18:35hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5b1e305c9fbb7e5f88dddf0dfb8a493b28c18734 [^]
2014-11-15 18:38hgbotCheckin
2014-11-15 18:38hgbotNote Added: 0071667
2014-11-15 18:38hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5b1e305c9fbb7e5f88dddf0dfb8a493b28c18734 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/43be7bcbc69f3b4ea68bd384c83e77d660dba56e [^]
2014-11-24 06:41mtaalAssigned Tomarvintm => mario_castello
2014-11-24 06:41mtaalNote Added: 0071908
2014-11-24 06:41mtaalStatusresolved => new
2014-11-24 06:41mtaalResolutionfixed => open
2014-11-25 12:13malsasuaRelationship addedrelated to 0028272
2014-11-25 12:15malsasuaNote Added: 0071973
2014-11-28 15:14hgbotCheckin
2014-11-28 15:14hgbotNote Added: 0072142
2014-11-28 15:14hgbotStatusnew => resolved
2014-11-28 15:14hgbotResolutionopen => fixed
2014-11-28 15:14hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/43be7bcbc69f3b4ea68bd384c83e77d660dba56e [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b804c4dfe156eadd726082db3fd9bdf0743a8d14 [^]
2014-12-01 18:50malsasuaReview Assigned To => malsasua
2014-12-01 18:50malsasuaNote Added: 0072218
2014-12-01 18:50malsasuaStatusresolved => closed
2014-12-01 18:50malsasuaFixed in Version => RR15Q1
2015-04-13 13:34egoitzRelationship addedrelated to 0029572

Notes
(0071666)
hgbot   
2014-11-15 18:35   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 5b1e305c9fbb7e5f88dddf0dfb8a493b28c18734
Author: Salvador Zapata <salvador.zapata <at> gmail.com>
Date: Sat Nov 15 14:33:47 2014 -0300
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5b1e305c9fbb7e5f88dddf0dfb8a493b28c18734 [^]

Fixed issue 28102: Include document number generation and creation information inside the success callback of the hook execution

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---
(0071667)
hgbot   
2014-11-15 18:38   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 43be7bcbc69f3b4ea68bd384c83e77d660dba56e
Author: Salvador Zapata <salvador.zapata <at> gmail.com>
Date: Sat Nov 15 14:37:47 2014 -0300
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/43be7bcbc69f3b4ea68bd384c83e77d660dba56e [^]

Fixed issue 28102: delete deprecated comment

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---
(0071908)
mtaal   
2014-11-24 06:41   
Reviewed, following comments:
- I tested it with this hook:
OB.UTIL.HookManager.registerHook('OBPOS_PreOrderSave', function (args, callbacks) {
      args.cancellation = true;
      OB.MobileApp.model.hookManager.callbackExecutor(args, callbacks);
    });

- But ticket was not cancelled, it was saved in the background it seems, I see in the multi order save that there is this code:
        if (args && args.cancellation && args.cancellation === true) {
          args.context.receipt.set('isbeingprocessed', 'N');
          return true;
        }
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/file/5b1e305c9fbb/web/org.openbravo.retail.posterminal/js/data/dataordersave.js#l243 [^]

But this code is not present in the single order save.

When I add the above code to the single order pre-save and try to pay the browser remains showing a loading message after paying
(0071973)
malsasua   
2014-11-25 12:15   
The code about cancellation was removed by error in this changeset https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/f7d836b8cbb7a68b9f124ff0715fd282a4c1d56c [^]
and new issue has been created and fixed:
https://issues.openbravo.com/view.php?id=28272 [^]
(0072142)
hgbot   
2014-11-28 15:14   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: b804c4dfe156eadd726082db3fd9bdf0743a8d14
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Fri Nov 28 08:13:11 2014 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b804c4dfe156eadd726082db3fd9bdf0743a8d14 [^]

fixed issue 28102: Hook OBPOS_PreOrderSave is not working fine if you cancel the save process

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/payment.js
---
(0072218)
malsasua   
2014-12-01 18:50   
verified