Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0044421 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Retail Modules] Multi order payment | major | always | 2020-06-19 09:55 | 2020-06-25 15:51 | |||
Reporter | aaroncalero | View Status | public | |||||
Assigned To | ranjith_qualiantech_com | |||||||
Priority | high | Resolution | fixed | Fixed in Version | RR20Q3 | |||
Status | closed | Fix in branch | Fixed in SCM revision | 2dc1f07ca39e | ||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | ||||||||
Review Assigned To | marvintm | |||||||
OBNetwork customer | Gold | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0044421: Multiorders prepayment calculation and OBPOS_hookPostMultiOrder hook are executed in parallel | |||||||
Description | When navigating to the Pay Open Tickets window to pay several orders at the same time, there's a series of hooks and events to notify that the process has finished. On the one hand there is the loadedMultiOrder event which, when triggered, it will launch the calculation of the prepayment amount. On the other hand, there is the OBPOS_hookPostMultiOrder hook, which allows developers to add extra code after the Pay Open Tickets window has loaded (i.e. some custom code to automatically propose the use of credit notes). These two points happen at the same time asynchronously, which can lead to the model in the hook to have incomplete information (i.e. missing totals) | |||||||
Steps To Reproduce | Check the code here [1] The hook is invoked right after triggering the event. If any code inside the event handling is asynchronous (i.e. the prepayments calculation, which happens at the end of that handler[2]) the hook will be invoked before the event handling has finished. [1] https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/file/tip/web/org.openbravo.retail.posterminal/js/pointofsale/view/pointofsale.js#l2073 [^] [2] https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/file/tip/web/org.openbravo.retail.posterminal/js/components/order.js#l1800 [^] | |||||||
Proposed Solution | The handler for the loadedMultiOrder already accepts a callback as a parameter. Wrap the call to OB.UTIL.HookManager.executeHooks in [1] in a function and add it as a callback of the loadedMultiOrder trigger. This way we can ensure that the prepayment calculation (and any other async code in the handler) has finished before executing the hooks. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
|
![]() |
|
(0121007) hgbot (developer) 2020-06-24 06:43 |
Repository: erp/pmods/org.openbravo.retail.posterminal Changeset: 2dc1f07ca39e0eb5e42cb2b6060ce2b3c587076a Author: Ranjith S R <ranjith <at> qualiantech.com> Date: Wed Jun 24 10:12:38 2020 +0530 URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2dc1f07ca39e0eb5e42cb2b6060ce2b3c587076a [^] Fixed issue-44421: Hook PostMultiOrder should be called in callback of loadedMultiOrder --- M web/org.openbravo.retail.posterminal/js/pointofsale/view/pointofsale.js --- |
![]() |
|||
Date Modified | Username | Field | Change |
2020-06-19 09:55 | aaroncalero | New Issue | |
2020-06-19 09:55 | aaroncalero | Assigned To | => Retail |
2020-06-19 09:55 | aaroncalero | OBNetwork customer | => Gold |
2020-06-19 09:55 | aaroncalero | Resolution time | => 1594332000 |
2020-06-19 09:55 | aaroncalero | Triggers an Emergency Pack | => No |
2020-06-23 07:52 | ranjith_qualiantech_com | Assigned To | Retail => ranjith_qualiantech_com |
2020-06-24 06:43 | hgbot | Checkin | |
2020-06-24 06:43 | hgbot | Note Added: 0121007 | |
2020-06-24 06:43 | hgbot | Status | new => resolved |
2020-06-24 06:43 | hgbot | Resolution | open => fixed |
2020-06-24 06:43 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2dc1f07ca39e0eb5e42cb2b6060ce2b3c587076a [^] |
2020-06-25 15:51 | marvintm | Review Assigned To | => marvintm |
2020-06-25 15:51 | marvintm | Status | resolved => closed |
2020-06-25 15:51 | marvintm | Fixed in Version | => RR20Q3 |
Copyright © 2000 - 2009 MantisBT Group |