Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0049494Openbravo ERP03. Procurement managementpublic2022-06-07 10:062022-08-10 01:13
kousalya_r 
AtulOpenbravo 
highmajoralways
closedfixed 
5
 
PR22Q4 
Core
No
0049494: Warehouse dropdown showing all warehouse in PO window
Please see the attached video. In Purchase order's warehouse dropdown, all warehouses are available and user can select any warehouse even if it is not even linked to that user's assigned organization.

To reproduce this issue we have created a role at organization level and user with that role has access to only one generic organization. But in Purchase order window all warehouses are available for selection.
video has been attached to reproduce the issue
No tags attached.
depends on backport 0049954PR22Q3 closed AtulOpenbravo Warehouse dropdown showing all warehouse in PO window 
depends on backport 0049955PR22Q2.2 closed AtulOpenbravo Warehouse dropdown showing all warehouse in PO window 
depends on backport 0049956PR22Q1.4 closed AtulOpenbravo Warehouse dropdown showing all warehouse in PO window 
depends on backport 00529373.0PR20Q1.1 closed AtulOpenbravo Warehouse dropdown showing all warehouse in PO window 
caused by defect 00284173.0PR15Q1 closed umartirena The warehouse selector in the Return Material Receipt window should not filter by warehouses on hand 
? 2022-06-03-12-26-14_WtrRZC8l.mp4 (1,548,342) 2022-06-07 10:06
https://issues.openbravo.com/file_download.php?file_id=17127&type=bug
png Screenshot from 2022-07-05 22-56-00.png (256,298) 2022-07-05 22:56
https://issues.openbravo.com/file_download.php?file_id=17279&type=bug
png
Issue History
2022-06-07 10:06kousalya_rNew Issue
2022-06-07 10:06kousalya_rAssigned To => Triage Omni OMS
2022-06-07 10:06kousalya_rFile Added: 2022-06-03-12-26-14_WtrRZC8l.mp4
2022-06-07 10:06kousalya_rModules => Core
2022-06-07 10:06kousalya_rTriggers an Emergency Pack => No
2022-06-07 10:59aferrazAssigned ToTriage Omni OMS => Triage Omni WMS
2022-07-04 10:32mtaalAssigned ToTriage Omni WMS => mtaal
2022-07-05 11:40mtaalRelationship addedcaused by 0028417
2022-07-05 11:41mtaalNote Added: 0139075
2022-07-05 22:56mtaalFile Added: Screenshot from 2022-07-05 22-56-00.png
2022-07-05 22:58mtaalNote Added: 0139111
2022-07-05 23:06mtaalNote Added: 0139112
2022-07-05 23:30mtaalNote Added: 0139113
2022-08-04 12:31vmromanosNote Added: 0139895
2022-08-04 12:37mtaalNote Added: 0139897
2022-08-04 12:37mtaalAssigned Tomtaal => AtulOpenbravo
2022-08-04 12:40mtaalNote Added: 0139898
2022-08-04 12:43mtaalStatusnew => scheduled
2022-08-08 10:39mtaalNote Deleted: 0139897
2022-08-09 12:04hgbotNote Added: 0140002
2022-08-09 19:25AtulOpenbravoNote Added: 0140012
2022-08-10 01:13hgbotResolutionopen => fixed
2022-08-10 01:13hgbotStatusscheduled => closed
2022-08-10 01:13hgbotNote Added: 0140022
2022-08-10 01:13hgbotFixed in Version => PR22Q4
2022-08-10 01:13hgbotNote Added: 0140023
2023-07-08 00:31axelmercadoRelationship addeddepends on 0052937

Notes
(0139075)
mtaal   
2022-07-05 11:41   
Note, analysis the warehouses are filtered like this in the obui selector for the warehouse column:
It seems explicitly show all the warehouses if it is not a sales transaction.

"( (" + OB.isSalesTransaction() + " = true and w.id in (select ow.warehouse.id from OrganizationWarehouse ow where ow.warehouse.id = w.id and ow.organization.id = \'" + OB.getParameters().get('inpadOrgId') + "\' )) or ((" + OB.isSalesTransaction() + " = false or \'"+OB.getWindowId()+"\' in (\'123271B9AD60469BAE8A924841456B63\'))))"
(0139111)
mtaal   
2022-07-05 22:58   
See attached screenshot. The m_warehouse_id column of c_order has the field 'Allow Cross Organization Reference' checked. This causes the selector logic to not include an organization filter.

Unchecking this field adds the organization filter in the selector logic on the server.
(0139112)
mtaal   
2022-07-05 23:06   
See the location in the source where it is used:
https://gitlab.com/openbravo/product/openbravo/-/blob/master/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java#L239 [^]
(0139113)
mtaal   
2022-07-05 23:30   
The cross org field was introduced 6 yrs ago. Initially the value was N, in a later changeset [1] for cross-org support it was set to Y.

[1]
2019-02-19 Álvaro Ferraz [CrossStore] Enable crossOrgReference in multiple columns:

https://code.openbravo.com/erp/devel/pi/diff/db0df3a406a9/src-db/database/sourcedata/AD_COLUMN.xml#l1.26 [^]
(0139895)
vmromanos   
2022-08-04 12:31   
Let's adapt the selector to filter by organizations as if the allow cross org were unset.

Please note the Goods Receipt window is also affected by this bug, so the fix and test plan should cover it too.
(0139898)
mtaal   
2022-08-04 12:40   
backport should be done to three releases: 22Q1, 22Q2 and 22Q3
(0140002)
hgbot   
2022-08-09 12:04   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/673 [^]
(0140012)
AtulOpenbravo   
2022-08-09 19:25   
Test Plan

- Login with Role F&B US Inc Procurement Role. This role has access to F&B US Inc, East Coast and West Coast Organzination.
- Create Purchase Order with F&B US Inc Organization.
- Check in Warehouse you have two options available i.e East Coast Warehouse and West Coast Warehouse.
- Set Organization as F&B US East Coast Org, check that only organization available is East Coast Warehouse
- Set Organziation as F&B US West Coast Org, check that only organization available is West Coast Warehouse
- Create a new Warehouse in F&B Internation Group Organization i.e for eg Group Warehouse.
- Create Purchase Order with F&B US Inc Organization.
- Check in Warehouse you have three options available i.e Group Warehouse, East Coast Warehouse and West Coast Warehoue.
- Set Organization as F&B US East Coast Org, check that only organization available are Group Warehouse and East Coast Warehouse
- Set Organziation as F&B US West Coast Org, check that only organization available are Group Warehouse and West Coast Warehouse

- Same also applies for Goods Receipt, Return To Vendor, Return To Vendor Shipment, Return Material Receipt window
- For Return From Customer and Sales Order, warehouse defined in natural tree org of transaction are available only if they
are defined in On Hand Warehouse tab.
(0140022)
hgbot   
2022-08-10 01:13   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/673 [^]
(0140023)
hgbot   
2022-08-10 01:13   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 30dc426b0db43f0171f0f2961b8c39b2b242d62b
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 09-08-2022 23:12:55
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/30dc426b0db43f0171f0f2961b8c39b2b242d62b [^]

Fixes BUG-0049494: Warehouse dropdown showing all warehouse
in PO window

**Added check whether warehouse organization is in the
transaction org natural tree or not only in the case of
non sales transaction

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