Openbravo Issue Tracking System - Retail Modules
View Issue Details
0033291Retail ModulesWeb POSpublic2016-06-16 13:242016-08-19 10:26
aaroncalero 
ranjith_qualiantech_com 
normalmajoralways
closedfixed 
5
 
RR16Q3 
mtaal
No
0033291: [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.
SER-QA
depends on backport 0033748RR16Q2.2 closed ranjith_qualiantech_com [SERQA 1304] Approval not granted if the user has more than one preference allowing an action 
related to defect 0033357 new Retail Overriding approval preference with value N does not work 
Issue History
2016-06-16 13:24aaroncaleroNew Issue
2016-06-16 13:24aaroncaleroAssigned To => Retail
2016-06-16 13:24aaroncaleroResolution time => 1467237600
2016-06-16 13:24aaroncaleroTriggers an Emergency Pack => No
2016-06-16 13:27aaroncaleroTag Attached: SER-QA
2016-06-16 13:27aaroncaleroSummaryApproval not granted if the user has more than one preference allowing an action => [SERQA 1304] Approval not granted if the user has more than one preference allowing an action
2016-06-17 12:34marvintmStatusnew => acknowledged
2016-06-20 06:24ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2016-06-20 06:24ranjith_qualiantech_comStatusacknowledged => scheduled
2016-06-20 12:30hgbotCheckin
2016-06-20 12:30hgbotNote Added: 0087660
2016-06-20 12:30hgbotStatusscheduled => resolved
2016-06-20 12:30hgbotResolutionopen => fixed
2016-06-20 12:30hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/fb99be0138c620e4eee7835281d0392a026bb155 [^]
2016-06-20 12:30hgbotCheckin
2016-06-20 12:30hgbotNote Added: 0087661
2016-06-23 19:20marvintmReview Assigned To => mtaal
2016-06-25 19:52mtaalNote Added: 0087916
2016-06-25 19:52mtaalStatusresolved => closed
2016-06-25 19:52mtaalFixed in Version => RR16Q3
2016-06-25 19:55mtaalRelationship addedrelated to 0033357
2016-08-18 19:18hgbotCheckin
2016-08-18 19:18hgbotNote Added: 0089225
2016-08-19 10:25guilleaerStatusclosed => new
2016-08-19 10:25guilleaerResolutionfixed => open
2016-08-19 10:25guilleaerFixed in VersionRR16Q3 =>
2016-08-19 10:25guilleaerStatusnew => scheduled
2016-08-19 10:25guilleaerStatusscheduled => resolved
2016-08-19 10:25guilleaerResolutionopen => fixed
2016-08-19 10:26guilleaerStatusresolved => closed
2016-08-19 10:26guilleaerFixed in Version => RR16Q4
2016-08-19 10:26guilleaerFixed in VersionRR16Q4 => RR16Q3

Notes
(0087660)
hgbot   
2016-06-20 12:30   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: fb99be0138c620e4eee7835281d0392a026bb155
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jun 20 15:59:37 2016 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/fb99be0138c620e4eee7835281d0392a026bb155 [^]

Fixes issue 33291 : Changes in CheckApproval Query to remove duplicate

- groupby clause added to query inorder to remove duplicated

---
M src/org/openbravo/retail/posterminal/utility/CheckApproval.java
---
(0087661)
hgbot   
2016-06-20 12:30   
Repository: tools/automation/pi-mobile
Changeset: f0abd36d3f31e6de666215c0f21de9b07276c165
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jun 20 15:59:27 2016 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/f0abd36d3f31e6de666215c0f21de9b07276c165 [^]

Verifies issue 33291 : Added automated test 'I33291_CheckApprovalBasedonPreference'

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I33291_CheckApprovalBasedonPreference.java
---
(0087916)
mtaal   
2016-06-25 19:52   
Reviewed and tested
(0089225)
hgbot   
2016-08-18 19:18   
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

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