Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036877Openbravo ERP09. Financial managementpublic2017-09-18 13:432017-09-25 14:30
caristu 
aferraz 
highminoralways
closedfixed 
5
 
3.0PR17Q4 
aferraz
Core
No
0036877: Organization selector in Purchase Order Report should restrict the organizations that can be displayed
After the fix for issue 0036151 the organization selector in a process definition displays by default the readable organizations of the role in the current context.

In the case of the "Purchase Order Report" it makes sense to display just the organizations which are direct accessible by the role in the current context,i.e., those organizations whose access has been explicitly set in the "Role Organization" subtab of the role ([Role] window)
1) Login as "F&B España Procurement Role"
2) Open the "Purchase Order Report"
3) Note that all the readable organizations of the role are displayed. In this case the organizations that should be displayed are: F&B España, F&B España Region Norte and F&B España Region Sur
Create a new reference to be used for the organization parameter in the "Purchase Order Report".

This can be done using different approaches, attached two proposed solutions that must be reviewed:

1) By using a filter expression which restricts the organizations to be displayed by taking into account the organizations direct accessible by the role.

2) By using a filter expression based on a FilterExpression class which also takes into account the user level of the process definition to discard or include the '*' organization.
No tags attached.
related to defect 0036151 closed caristu organization selector in process definition don't filter by role's org access 
related to defect 0036931 closed caristu Process definition with data access level = System only can be launched as normal client 
diff newOrgReference1.diff (5,015) 2017-09-18 13:43
https://issues.openbravo.com/file_download.php?file_id=11069&type=bug
diff newOrgReference2.diff (8,235) 2017-09-18 13:44
https://issues.openbravo.com/file_download.php?file_id=11070&type=bug
Issue History
2017-09-18 13:43caristuNew Issue
2017-09-18 13:43caristuAssigned To => Triage Finance
2017-09-18 13:43caristuModules => Core
2017-09-18 13:43caristuTriggers an Emergency Pack => No
2017-09-18 13:43caristuFile Added: newOrgReference1.diff
2017-09-18 13:44caristuFile Added: newOrgReference2.diff
2017-09-18 13:44caristuRelationship addedrelated to 0036151
2017-09-18 14:13caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15925#r15925
2017-09-22 15:42hgbotCheckin
2017-09-22 15:42hgbotNote Added: 0099497
2017-09-22 15:42hgbotStatusnew => resolved
2017-09-22 15:42hgbotResolutionopen => fixed
2017-09-22 15:42hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/def13514e4af4da7689a48b3277e940a4c213bde [^]
2017-09-22 15:42hgbotCheckin
2017-09-22 15:42hgbotNote Added: 0099498
2017-09-22 15:43aferrazAssigned ToTriage Finance => aferraz
2017-09-22 15:43aferrazReview Assigned To => aferraz
2017-09-22 15:43aferrazNote Added: 0099499
2017-09-22 15:43aferrazStatusresolved => closed
2017-09-22 15:43aferrazFixed in Version => 3.0PR17Q4
2017-09-22 15:47aferrazRelationship addedrelated to 0036931
2017-09-25 14:30hudsonbotCheckin
2017-09-25 14:30hudsonbotNote Added: 0099556
2017-09-25 14:30hudsonbotCheckin
2017-09-25 14:30hudsonbotNote Added: 0099557

Notes
(0099497)
hgbot   
2017-09-22 15:42   
Repository: erp/devel/pi
Changeset: def13514e4af4da7689a48b3277e940a4c213bde
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Sep 22 09:55:57 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/def13514e4af4da7689a48b3277e940a4c213bde [^]

Fixes issue 36877: New Organization selector for Purchase Order Report

---
M src-db/database/sourcedata/AD_REFERENCE.xml
M src-db/database/sourcedata/OBUIAPP_PARAMETER.xml
M src-db/database/sourcedata/OBUISEL_SELECTOR.xml
A src/org/openbravo/erpCommon/info/ContextRoleDirectAccessibleOrganizations.java
---
(0099498)
hgbot   
2017-09-22 15:42   
Repository: erp/devel/pi
Changeset: 2955207cac37aba0f003c0226e7b42d7216f854e
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Sep 22 15:20:34 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/2955207cac37aba0f003c0226e7b42d7216f854e [^]

Related to issue 36877: Code review improvements

Avoid in clause which can have problems in Oracle, and use exists clause instead.
Check data access level from both process definition and report and process.
Depending on data access level, selector will retrieve following organizations:
- Organization: Role org access organizations.
- All or Client/Organization: Role org access organizations + * organization.
- System/Client: * organization.

---
M src/org/openbravo/erpCommon/info/ContextRoleDirectAccessibleOrganizations.java
---
(0099499)
aferraz   
2017-09-22 15:43   
Code review + Testing of attached newOrgReference2.diff fix OK
(0099556)
hudsonbot   
2017-09-25 14:30   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/d8fd6d1ecc14 [^]
Maturity status: Test
(0099557)
hudsonbot   
2017-09-25 14:30   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/d8fd6d1ecc14 [^]
Maturity status: Test