Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0030797 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] A. Platform | major | always | 2015-09-08 16:49 | 2015-09-10 09:37 | |||
Reporter | vmromanos | View Status | public | |||||
Assigned To | alostale | |||||||
Priority | normal | Resolution | no change required | Fixed in Version | ||||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
Projection | none | ETA | none | Target Version | 3.0PR15Q4 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Review Assigned To | ||||||||
Web browser | ||||||||
Modules | Core | |||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0030797: Validation rule automatically adds wrong organization list to the where clause | |||||||
Description | When you define a validation rule it is automatically included in a generic SQL query; the filter by organization and client is automatically set by the system. Example: SELECT td0.M_PriceList_Version_ID AS ID, (COALESCE(TO_CHAR(COALESCE(TO_CHAR(td0.Name),'')),'')) AS NAME, '' AS DESCRIPTION FROM M_PriceList_Version td0 WHERE td0.AD_Client_ID IN ('0','23C59575B9CF467C9620760EB255B389') AND td0.AD_Org_ID IN ('E443A31992CB4635AFCAEABE7183CE85','B843C30461EA4501935CB1D125C9C25A','19404EAD144C49A0AF37D54377CF452D','0') AND (<Here the validation rule>) ; The problem is that the organization list is wrong in the following scenario: 1. A role is defined with User Level = "Organization" 2. In the Role | Organization tab, we define access for Norte and Sur organizations only In this scenario, the where clause for organizations automatically created for the validation rule is: AND td0.AD_Org_ID IN ('E443A31992CB4635AFCAEABE7183CE85','B843C30461EA4501935CB1D125C9C25A','19404EAD144C49A0AF37D54377CF452D','0') which corresponds to Norte (which is the context's organization) and its parents. This is wrong, as in this concrete case the list should include only Norte and Sur, because it's a role with User Level = Organization and access to Norte and Sur. Please note that this only happens when the User Level = Organization. If we set it to "Client+Organization", then the where clause properly includes Norte, Sur and * | |||||||
Steps To Reproduce | In a recent PI instance (with 0030735 fixed) Login as admin role: Create a new role: Name: rn + rs User level: Organization Org Access: include only Norte and Sur orgs User assignment: Openbravo Create a price list: Name: rn Org: Norte Sales Price list = Y Create a Price List version: Name: rn plv Create a price list: Name: rs Org: Sur Sales Price list = Y Create a Price List version: Name: rs plv Log out & log in with Openbravo user Change the role to rn + rs Go to Product window: Select Agua sin Gas Go to Price window: Create a new record: The only pricelist version is "rn plv". This is wrong, "rn plv" and "rs plv" should be displayed, because they are defined for Norte and Sur and the role has access to them. Go to Price List window. Search the "rs" price list Go to price list version and the Price tab. Enter a new record. The system allows you. That's OK. If you now change the role's access level to "Client + Organization", you can select "rn plv" and "rs plv" in Product | Price, Price List Version field | |||||||
Proposed Solution | It seems there is something wrong in UIDefinition.java, method getValueInComboReference() when getting the list of organizations to be included in the where clause of the validation rule | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | ||||||||||||||||||||||
|
Notes | |
(0080308) alostale (manager) 2015-09-10 09:37 |
It has nothing to do with validation rule but with organization visibility. 1. Login as sys admin 1.1 Make visible organization field in Price > List tab 2. Login as rn + rs with organization level 2.1 Select Agua sin Gas product 2.2 Create a new price -> New record is defaulted to organization Norte 2.3 Open price list version drop down -> Only plv n is displayed 2.4 Change org to Sur 2.5 Open price list version drop down -> Only plv s is displayed 3. Login as rn + rs with client/organization level 3.1 Select Agua sin Gas product 3.2 Create a new price -> New record is defaulted to organization * 3.3 Open price list version drop down -> plv n + plv s are displayed 3.4 Change org to Sur 3.5 Open price list version drop down -> Only plv s is displayed Note Agua product is in España organization (which is parent both for Norte and Sur), it can be seen from both roles but none of them has write access there. When creating a new record in Price tab, it cannot be defaulted to España as it is not writable, so a different writable org is selected (Norte in case of organization level access, * in case of client/org access). In both cases, elements in price list version are restricted to those ones that can be referred from current record's organization (this is, the natural organization tree: all ancestors and descendants from current org): * In case 2.2 only Norte can be referred from org Norte * In cases 2.5 and 3.5 only Sur can be referred from org Sur * In case 3.3 Norte and Sur can be referred from org * Note fix for issue 0030735 adds an extra limitation to the price lists that appear in the drop down, filtering out from referable organizations those that current role has not write access to. |
Issue History | |||
Date Modified | Username | Field | Change |
2015-09-08 16:49 | vmromanos | New Issue | |
2015-09-08 16:49 | vmromanos | Assigned To | => platform |
2015-09-08 16:49 | vmromanos | Modules | => Core |
2015-09-08 16:49 | vmromanos | Triggers an Emergency Pack | => No |
2015-09-08 16:52 | vmromanos | Relationship added | related to 0030735 |
2015-09-09 13:35 | alostale | Target Version | => 3.0PR15Q4 |
2015-09-09 13:35 | alostale | Status | new => scheduled |
2015-09-09 13:35 | alostale | Assigned To | platform => alostale |
2015-09-10 09:11 | alostale | Relationship added | related to 0027459 |
2015-09-10 09:37 | alostale | Note Added: 0080308 | |
2015-09-10 09:37 | alostale | Status | scheduled => closed |
2015-09-10 09:37 | alostale | Resolution | open => no change required |
2015-09-25 08:49 | vmromanos | Relationship added | related to 0030926 |
Copyright © 2000 - 2009 MantisBT Group |