Openbravo Issue Tracking System - Retail Modules
View Issue Details
0031114Retail ModulesWeb POSpublic2015-10-08 18:302015-10-28 16:03
adrianromero 
adrianromero 
normalminorhave not tried
closedfixed 
5
 
RR16Q1 
marvintm
No
0031114: New approval message is not validated properly
The new approval messages implemented in changeset https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/b367392dc5bed7e651b440e3d65ecd5e46d49b94 [^] does not work properly with the function https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/b282d25d0fd0/web/org.openbravo.mobile.core/source/component/obpos-approval.js#l23 [^] that expects as approvalType an string or array of strings
Currently there is no code in POS that uses this new functionality.
Steps to try this with a preference created on the fly, using developer tools:
Execute the following:
OB.MobileApp.model.attributes.permissions.test_dummy = false;
OB.UTIL.Approval.requestApproval(OB.MobileApp.view.$.containerWindow.$.pointOfSale.model, 'test_dummy', function(approved){if(approved){alert('done');}});
>> Verify that the 'Supervisor Required' popup is shown.
OB.MobileApp.model.attributes.permissions.test_dummy = true;
>> Verify that now the 'done' alert is shown (test_dummy approval granted).
OB.UTIL.Approval.requestApproval(OB.MobileApp.view.$.containerWindow.$.pointOfSale.model, {
  approval: 'test_dummy',
  message: 'test_dummy',
  params: []
}, function(approved){if(approved){alert('done');}});
>> ERROR: 'Supervisor Required' popup is shown, even if we have the permission for 'test_dummy'.
see attached patch
No tags attached.
related to feature request 0027002 closed ebecerra Extend Approval dialog to allow show custom message on approval dialog. 
diff issue31114.diff (683) 2015-10-08 18:32
https://issues.openbravo.com/file_download.php?file_id=8546&type=bug
Issue History
2015-10-08 18:30adrianromeroNew Issue
2015-10-08 18:30adrianromeroAssigned To => Retail
2015-10-08 18:30adrianromeroTriggers an Emergency Pack => No
2015-10-08 18:30adrianromeroRelationship addedrelated to 0027002
2015-10-08 18:32adrianromeroFile Added: issue31114.diff
2015-10-09 08:41aaroncaleroSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9653#r9653
2015-10-19 18:57hgbotCheckin
2015-10-19 18:57hgbotNote Added: 0081100
2015-10-19 18:57hgbotStatusnew => resolved
2015-10-19 18:57hgbotResolutionopen => fixed
2015-10-19 18:57hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/2aa4e1c6ba9093a8be2b8c781e0c05e670b2ee33 [^]
2015-10-20 09:16marvintmAssigned ToRetail => adrianromero
2015-10-27 09:13adrianromeroReview Assigned To => marvintm
2015-10-28 16:03marvintmStatusresolved => closed
2015-10-28 16:03marvintmFixed in Version => RR16Q1

Notes
(0081100)
hgbot   
2015-10-19 18:57   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 2aa4e1c6ba9093a8be2b8c781e0c05e670b2ee33
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Fri Oct 09 08:36:48 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/2aa4e1c6ba9093a8be2b8c781e0c05e670b2ee33 [^]

Fixes issue 0031114: New approval message is not validated properly
* Now function hasPermission accepts all type of objects can be used to invoke the function

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---