Openbravo Issue Tracking System - Retail Modules
View Issue Details
0044345Retail ModulesWeb POSpublic2020-06-11 12:102020-07-08 12:16
jorge-garcia 
ranjith_qualiantech_com 
normalmajorhave not tried
closedfixed 
5
 
RR20Q4 
marvintm
No
0044345: If a OBPOS_LoadPOSWindow hook is executed after the registered hook of sessions, WebPOS could navigate to pointofsale window
Sessions hook could navigate directly to point of sale window before all OBPOS_LoadPOSWindow has been executed.

This may cause random problem in the code.
1) Using a enviromnet with sessions module, login in ERP
2) Go to VBS-1 record in Touchpoint window and navigate to its Touchpoint Type window
3) Go through each Payment Method and uncheck checkbox of Initial Count Cash

4) Go to WebPOs VBS-1 and before do login in, introduce this code using developers tools
  OB.UTIL.HookManager.registerHook('OBPOS_LoadPOSWindow', function (
    args,
    callbacks
  ) {
    setTimeout(function () {
      OB.UTIL.showConfirmation.display(
        'Interrupt popup',
        'This popup is shown in top of good job popup',
        [
          {
            label: OB.I18N.getLabel('OBMOBC_LblOk'),
            isConfirmButton: true,
            action: function () {
              OB.UTIL.HookManager.callbackExecutor(args, callbacks);
            }
          }
        ]
      );
    }, 1000);
  });
5) Now, login in WebPOS
6) Notice that no initial count cash is needed but for a second the good job popup is shown. After that, our new popup is shown in top of it.
7) Click on OK button and verify WebPOS is stuck in showLoading window.
8) Refresh the webPOS and try to do login and check nothing is happening
At step 8, the webPOS thinks that the webPOs is still loging in an does not allow to do again the login (this could be check in console of chrome).
The problem is at this point of the code https://code.openbravo.com/erp/pmods/org.openbravo.retail.sessions/file/tip/web/org.openbravo.retail.sessions/js/countcash/countcash-model.js#l97 [^]

The callback (which is the hook callback) is launched and the good job popup is shown. The ok button initiates the navigation to webPOS. As this popup is override by the confirmation popup, the logic thinks the login process is still ongoing.

The solution is to avoid sessions hook to initiate the navigation and let the OBPOS_LoadPOSWindow hook callback to initiate the naviagtion.

An partial diff to avoid this kind of problems could be check here:
https://gitlab.com/obcustomers/DKTFR/org.openbravo.retail.sessions-fr-dev/-/commit/e83b97a5bdec6dd1a3b6780e6b86fd66f858786c [^]
No tags attached.
Issue History
2020-06-11 12:10jorge-garciaNew Issue
2020-06-11 12:10jorge-garciaAssigned To => Retail
2020-06-11 12:10jorge-garciaTriggers an Emergency Pack => No
2020-06-11 12:14jorge-garciaResolution time => 1593640800
2020-06-16 14:08jorge-garciaRelationship addedrelated to 0044244
2020-06-24 08:12ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2020-07-01 07:59ranjith_qualiantech_comStatusnew => scheduled
2020-07-02 19:00marvintmResolution time1593640800 => 1594245600
2020-07-08 11:50hgbotCheckin
2020-07-08 11:50hgbotNote Added: 0121324
2020-07-08 11:50hgbotStatusscheduled => resolved
2020-07-08 11:50hgbotResolutionopen => fixed
2020-07-08 11:50hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.sessions/rev/c6b41d47c61f4e4a86332b4078f8f9487302376d [^]
2020-07-08 12:16marvintmReview Assigned To => marvintm
2020-07-08 12:16marvintmStatusresolved => closed
2020-07-08 12:16marvintmFixed in Version => RR20Q4

Notes
(0121324)
hgbot   
2020-07-08 11:50   
Repository: erp/pmods/org.openbravo.retail.sessions
Changeset: c6b41d47c61f4e4a86332b4078f8f9487302376d
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Jul 08 15:20:39 2020 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.sessions/rev/c6b41d47c61f4e4a86332b4078f8f9487302376d [^]

Fixed issue-44345: LoadPOSWindow hook should be called after opentill popup closed

* In the LoadPOSWindow hook, OpenTill process will be started.
  hook callback should be called only when GoodJob popup of OpenTill completion process

---
M web/org.openbravo.retail.sessions/js/components/BusinessDateModel.js
M web/org.openbravo.retail.sessions/js/components/loginhook.js
M web/org.openbravo.retail.sessions/js/countcash/countcash-model.js
---