Openbravo Issue Tracking System - Retail Modules
View Issue Details
0033748Retail ModulesWeb POSpublic2016-06-16 13:242016-08-19 10:29
aaroncalero 
ranjith_qualiantech_com 
normalmajoralways
closedfixed 
5
 
RR16Q2.2RR16Q2.2 
guilleaer
No
0033748: [SERQA 1304] Approval not granted if the user has more than one preference allowing an action
If a user has different preferences granting approval for an action (e.g. one configured for the specific user and one configured for its role), if the user tries to approve that action, the system doesn't allow it.
Using livebuilds:
Login in backend and go to the preference window.
Configure the following preferences:
Web POS Delete Line Approval, value:Y, Visible at user: Openbravo.
Web POS Delete Line Approval, value:Y, Visible at role: The White Valley Group Admin
Web POS Delete Line Approval, value:N, Visible at user: Vall Blanca Store User.

Login in web pos with user vallblanca.
Create a new ticket, add a line, and try to delete the line.
The Approval Required popup will be shown and Openbravo will be available as Supervisor.
Select Openbravo and write its password. Then click on Approve.
The 'User does not have privileges to approve this action' error will be shown and the line won't be deleted.
It is possible to send to the CheckAppoval.java file, which validates the supervisor credentials, several approvals at the same time to validate all of them together.
That process executes a query which filters permissions by role and user. The query is returning the whole preference object, although it only needs the 'property' value. After that, compares the amount of results returned by the query (which may include duplicated preferences), with the amount of approvals requested.

The proposed solution is to make the query return only the 'property' of the preference, and group by that field, so no duplicates are returned.
No tags attached.
blocks defect 0033291 closed ranjith_qualiantech_com [SERQA 1304] Approval not granted if the user has more than one preference allowing an action 
Issue History
2016-08-19 10:25guilleaerTypedefect => backport
2016-08-19 10:25guilleaerTarget Version => RR16Q2.2
2016-08-19 10:27guilleaerNote Added: 0089233
2016-08-19 10:27guilleaerStatusscheduled => resolved
2016-08-19 10:27guilleaerFixed in Version => RR16Q2.2
2016-08-19 10:27guilleaerResolutionopen => fixed
2016-08-19 10:29guilleaerReview Assigned Tomtaal => guilleaer
2016-08-19 10:29guilleaerStatusresolved => closed

Notes
(0089233)
guilleaer   
2016-08-19 10:27   
RESOLVED BY THIS COMMIT:

Repository: retail/backports/3.0RR16Q2.2/org.openbravo.retail.posterminal
Changeset: c6e632dcf5a8f752f7c8bc60c17cee351c8728ee
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jun 20 15:59:37 2016 +0530
URL: http://code.openbravo.com/retail/backports/3.0RR16Q2.2/org.openbravo.retail.posterminal/rev/c6e632dcf5a8f752f7c8bc60c17cee351c8728ee [^] [^]

Related to issue 0033590: Fixes for issue 33291. Changes in CheckApproval Query to remove duplicate

- groupby clause added to query inorder to remove duplicated

This changes are needed to apply the fix for this issue.

---
M src/org/openbravo/retail/posterminal/utility/CheckApproval.java
---