Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0041486
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajoralways2019-07-30 14:512019-08-07 08:02
ReporteraaroncaleroView Statuspublic 
Assigned Toalekosmp86 
PriorityhighResolutionfixedFixed in VersionRR19Q4
StatusclosedFix in branchFixed in SCM revision31963d7f3ee6
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarvintm
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0041486: Approvals don't work in offline mode when the approval is a complex object

DescriptionThe 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 ReproduceCheck 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 SolutionInstead 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.
TagsNo tags attached.
Attached Filesdiff file icon Issue41486.diff [^] (2,032 bytes) 2019-07-30 15:01 [Show Content]
diff file icon Issue41486_q1.diff [^] (2,194 bytes) 2019-07-30 15:03 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0113794)
hgbot (developer)
2019-08-02 20:02

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 31963d7f3ee66c6b6e52c59e19773d179eae9cc5
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Thu Aug 01 16:07:23 2019 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/31963d7f3ee66c6b6e52c59e19773d179eae9cc5 [^]

Fixed issue 41486: When in offline mode, if the approval is a complex object, then
the proper value of the approval is taken from it.

---
M web/org.openbravo.retail.posterminal/js/utils/ob-utilitiesuipos.js
---

- 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 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


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker