Openbravo Issue Tracking System - Retail Modules | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0041486 | Retail Modules | Web POS | public | 2019-07-30 14:51 | 2019-08-07 08:02 |
Reporter | aaroncalero | ||||
Assigned To | alekosmp86 | ||||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | RR19Q4 | |||
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 | 0041486: Approvals don't work in offline mode when the approval is a complex object | ||||
Description | The OB.UTIL.Approval.requestApproval API supports approvals passed as single strings, and also as objects (with approval, message and optional params). When a call to requestApproval is done in offline mode with an object approval, it will always return the message "<User> does not have privileges to approve this action. | ||||
Steps To Reproduce | Check the code of the fail function in OB.UTIL.checkApproval: https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/file/tip/web/org.openbravo.retail.posterminal/js/utils/ob-utilitiesuipos.js#l594 [^] The approval is compared "as is" against the saved permissions, which is wrong. | ||||
Proposed Solution | Instead of checking the approval "as is": if (_.contains(JSON.parse(supervisor.get('permissions')), perm)) { Get from 'perm' the real approval and then check that approval on the saved permissions: var approvalToCheck = (typeof (perm) === 'object' ? perm.approval : perm); if (JSON.parse(user.get('terminalinfo')).permissions[approvalToCheck]) { Note: The same code appears 3 times on the same function. | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | ![]() https://issues.openbravo.com/file_download.php?file_id=13185&type=bug ![]() https://issues.openbravo.com/file_download.php?file_id=13186&type=bug | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2019-07-30 14:51 | aaroncalero | New Issue | |||
2019-07-30 14:51 | aaroncalero | Assigned To | => Retail | ||
2019-07-30 14:51 | aaroncalero | OBNetwork customer | => Gold | ||
2019-07-30 14:51 | aaroncalero | Resolution time | => 1565647200 | ||
2019-07-30 14:51 | aaroncalero | Triggers an Emergency Pack | => No | ||
2019-07-30 15:01 | aaroncalero | File Added: Issue41486.diff | |||
2019-07-30 15:03 | aaroncalero | File Added: Issue41486_q1.diff | |||
2019-08-01 20:54 | alekosmp86 | Assigned To | Retail => alekosmp86 | ||
2019-08-02 20:02 | hgbot | Checkin | |||
2019-08-02 20:02 | hgbot | Note Added: 0113794 | |||
2019-08-02 20:02 | hgbot | Status | new => resolved | ||
2019-08-02 20:02 | hgbot | Resolution | open => fixed | ||
2019-08-02 20:02 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/31963d7f3ee66c6b6e52c59e19773d179eae9cc5 [^] | ||
2019-08-07 08:02 | marvintm | Review Assigned To | => marvintm | ||
2019-08-07 08:02 | marvintm | Status | resolved => closed | ||
2019-08-07 08:02 | marvintm | Fixed in Version | => RR19Q4 |
Notes | |||||
|
|||||
|
|