Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0053866Openbravo ERP07. Sales managementpublic2023-11-06 15:502023-12-20 15:36
Daria_Sh 
Triage Platform Base 
immediatemajoralways
closedfixed 
5
 
PR24Q1 
Core
Automated tests
2023-10-17
pi
https://gitlab.com/openbravo/product/openbravo/-/commit/22b446ee1caf09bee0f4d8ca3ad6eb97f4164df5 [^]
No
0053866: 'No items to show' is shown when adding the 'Price List Version' to the new product
The 'Price List Version' dropdown list does not display any rows when creating a new product in Backoffice.
Issue reproducible in livebuilds "pi" but not reproducible in livebuilds 23Q3.1
1.Go to Backoffice (login: Openbravo/password: openbravo)
2.Proceed to Product window
3.Fulfill the necessary fields to create new product → Click Ctrl+S to save the changes
4.Navigate to 'Price' tab
5.Right click to create new record → Click the arrow to expand 'Price List Version' drop down list

Actual result: 'No items to show' is displaying
Expected result: The list with available 'Price Lists'(exists in Price List window) is displaying
No tags attached.
caused by defect 0053408 closed ablasco Do not persist access for automatic roles 
png Screenshot_6.png (97,674) 2023-11-06 15:50
https://issues.openbravo.com/file_download.php?file_id=19131&type=bug
png
Issue History
2023-11-06 15:50Daria_ShNew Issue
2023-11-06 15:50Daria_ShAssigned To => Triage Omni OMS
2023-11-06 15:50Daria_ShModules => Core
2023-11-06 15:50Daria_ShTriggers an Emergency Pack => No
2023-11-06 15:50Daria_ShFile Added: Screenshot_6.png
2023-11-14 15:07lorenzofidalgoRegression level => Automated tests
2023-11-14 15:07lorenzofidalgoRegression introduced in release => pi
2023-11-14 15:07lorenzofidalgoPrioritynormal => immediate
2023-11-14 15:07lorenzofidalgoSeverityminor => major
2023-11-14 15:07lorenzofidalgoReproducibilityhave not tried => always
2023-11-14 15:07lorenzofidalgoDescription Updatedbug_revision_view_page.php?rev_id=27124#r27124
2023-11-14 16:54lorenzofidalgoRelationship addedcaused by 0053408
2023-11-14 17:00lorenzofidalgoRegression date => 2023-10-17
2023-11-14 17:00lorenzofidalgoRegression introduced by commit => https://gitlab.com/openbravo/product/openbravo/-/commit/22b446ee1caf09bee0f4d8ca3ad6eb97f4164df5 [^]
2023-11-14 17:03aferrazAssigned ToTriage Omni OMS => Triage Platform Base
2023-11-14 17:36AugustoMauchNote Added: 0157146
2023-12-04 10:18hgbotNote Added: 0157934
2023-12-20 15:36hgbotResolutionopen => fixed
2023-12-20 15:36hgbotStatusnew => closed
2023-12-20 15:36hgbotNote Added: 0158415
2023-12-20 15:36hgbotFixed in Version => PR24Q1
2023-12-20 15:36hgbotNote Added: 0158416

Notes
(0157146)
AugustoMauch   
2023-11-14 17:36   
These are the afected validation rules:


<!--800022--> <CODE><![CDATA[AD_CLIENT.ISACTIVE = 'Y' AND EXISTS (SELECT 1 FROM AD_ROLE_ORGACCESS WHERE AD_ROLE_ORGACCESS.AD_CLIENT_ID = AD_CLIENT.AD_CLIENT_ID AND AD_ROLE_ORGACCESS.AD_ROLE_ID = @Default_AD_Role_ID@ AND AD_ROLE_ORGACCESS.ISACTIVE = 'Y')]]></CODE>

 name | name | tablevel | name | sqllogic
------+------+----------+----------------+----------
 User | User | 0 | Default Client |


<!--800023--> <CODE><![CDATA[EXISTS (SELECT 1 FROM AD_ROLE_ORGACCESS A_R_O, ad_role r
        WHERE A_R_O.AD_ORG_ID = AD_ORG.AD_Org_ID
        AND A_R_O.ISACTIVE = 'Y'
        AND A_R_O.AD_ROLE_ID = R.AD_ROLE_ID
        and r.ad_role_id = @Default_AD_Role_ID@
        AND R.ISACTIVE = 'Y'
        AND (LPAD(TO_CHAR(R.USERLEVEL), 1, '1')='S' OR AD_ORG.AD_ORG_ID <> '0')
        AND A_R_O.AD_ROLE_ID = @Default_AD_Role_ID@)]]></CODE>

db_pos2_modules=> select w.name, t.name, t.tablevel, f.name, c.sqllogic from ad_window w, ad_tab t, ad_field f, ad_column c where w.ad_window_id = t.ad_window_id and t.ad_tab_id = f.ad_tab_id and f.ad_column_id = c.ad_column_id and c.ad_column_id in (select ad_column_id from ad_column where ad_val_rule_id = '800023') order by 1, 2, 3;
 name | name | tablevel | name | sqllogic
------+------+----------+----------------------+----------
 User | User | 0 | Default Organization |
(1 row)


<!--994D5D0FB26D44988D04CE19D66B0A2C--> <CODE><![CDATA[EXISTS (SELECT 1
        FROM AD_ROLE_ORGACCESS A_R_O
        INNER JOIN ad_role r ON (A_R_O.AD_ROLE_ID = r.AD_ROLE_ID)
        WHERE A_R_O.ISACTIVE = 'Y'
        AND r.ISACTIVE = 'Y'
        and r.ad_role_id = @#AD_Role_ID@
        AND (A_R_O.AD_ORG_ID = td0.AD_Org_ID
             OR (SUBSTR(TO_CHAR(r.USERLEVEL), 2, 1) = 'C' AND td0.AD_ORG_ID = '0')
             )
        )]]></CODE>

db_pos2_modules=> select w.name, t.name, t.tablevel, f.name, c.sqllogic from ad_window w, ad_tab t, ad_field f, ad_column c where w.ad_window_id = t.ad_window_id and t.ad_tab_id = f.ad_tab_id and f.ad_column_id = c.ad_column_id and c.ad_column_id in (select ad_column_id from ad_column where ad_val_rule_id = '994D5D0FB26D44988D04CE19D66B0A2C') order by 1, 2, 3;
               name | name | tablevel | name | sqllogic
----------------------------------+-------------------------------+----------+--------------------+----------
 Commercial Operations by Product | Commercial Operations | 0 | Product Price |
 Commercial Operations by Product | Commercial Operations | 0 | Price List Version |
 Expense Type | Price | 2 | Price List Version |
 Price List | Product Price | 2 | Price List Version |
 Price List | Product Price with Exceptions | 3 | Product Price |
 Product | Price | 1 | Price List Version |
 Product | Product Price with Exceptions | 2 | Product Price |
 Resource | Price | 2 | Price List Version |


 <!--D9463AFD77E44F619D396C19BF9E6A15--> <CODE><![CDATA[EXISTS (SELECT 1 FROM AD_ROLE_ORGACCESS A_R_O, ad_role r
        WHERE A_R_O.AD_ORG_ID = AD_ORG.AD_Org_ID
        AND A_R_O.ISACTIVE = 'Y'
        AND A_R_O.AD_ROLE_ID = R.AD_ROLE_ID
        and r.ad_role_id = @#AD_Role_ID@
        AND R.ISACTIVE = 'Y'
        AND (LPAD(TO_CHAR(R.USERLEVEL), 1, '1')='S' OR AD_ORG.AD_ORG_ID <> '0')
        AND A_R_O.AD_ROLE_ID = @#AD_Role_ID@)]]></CODE>

db_pos2_modules=> select w.name, t.name, t.tablevel, f.name, c.sqllogic from ad_window w, ad_tab t, ad_field f, ad_column c where w.ad_window_id = t.ad_window_id and t.ad_tab_id = f.ad_tab_id and f.ad_column_id = c.ad_column_id and c.ad_column_id in (select ad_column_id from ad_column where ad_val_rule_id = 'D9463AFD77E44F619D396C19BF9E6A15') order by 1, 2, 3;
 name | name | tablevel | name | sqllogic
------+------+----------+------+----------
(0 rows)
(0157934)
hgbot   
2023-12-04 10:18   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1064 [^]
(0158415)
hgbot   
2023-12-20 15:36   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1064 [^]
(0158416)
hgbot   
2023-12-20 15:36   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 24a0faec07cb9eb6ed1493a13cd670897f48e8cd
Author: meriem azaf <meriem.azaf@openbravo.com>
Date: 20-12-2023 14:36:52
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/24a0faec07cb9eb6ed1493a13cd670897f48e8cd [^]

Fixes ISSUE-53866: 'No items to show' is shown when adding the 'Price List Version' to the new product

The 'Price List Version' dropdown list does not display any rows when creating a new product in Backoffice.

The problem was in 4 validation rules that use role_orgAccess table, so it is a regression related with recently merged automatic roles project.

That project removed all the role_orgaccess entries, as automatic roles now by default have access to all orgs of the client with their corresponding user-level.

To fix this, we added an extra query "EXISTS" before the old one to be executed where the role is automatic so the second will be executed when the role is manual.

---
M src-db/database/sourcedata/AD_VAL_RULE.xml
---