Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035899Openbravo ERP04. Warehouse managementpublic2017-05-02 18:392017-05-29 17:43
ngarcia 
collazoandy4 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q3 
aferraz
Core
No
0035899: In Stock Report, you can see stock for warehouse's that belong to an organization you don't have access to
In Stock Report, you can see stock for warehouse's that belong to an organization you don't have access to

The problem is that the records in m_transaction are filtered by the natural tree of the organization the user has access to and warehouses are not filtered at all
As group admin role:
   Create a new product for F&B España, S.A.
   Create a Goods Receipt for F&B España, S.A. and receive the previously created product in a storage bin of España Region Norte and a storage bin of España Region Sur
   Create a goods shipment for F&B España Region Norte and add the previously created product, reduce the shipped quantity not to leave its stock to 0
   Create a new advanced role
   Assign it to Openbravo user
   Remove the access to all the organizations except F&B España Region Sur
   Log out and log in
   Select the previously created role
   Launch the Stock Report and filter by the previously created role
   Check the stock in España Region Norte and Region Sur warehouses is shown which is not correct. Moreover, you see more stock than the available one in España Region Norte
No tags attached.
Issue History
2017-05-02 18:39ngarciaNew Issue
2017-05-02 18:39ngarciaAssigned To => Triage Finance
2017-05-02 18:39ngarciaModules => Core
2017-05-02 18:39ngarciaResolution time => 1495490400
2017-05-02 18:39ngarciaTriggers an Emergency Pack => No
2017-05-02 18:39ngarciaIssue Monitored: networkb
2017-05-02 23:24eugeniIssue Monitored: eugeni
2017-05-04 16:28aferrazAssigned ToTriage Finance => collazoandy4
2017-05-05 23:12collazoandy4Statusnew => scheduled
2017-05-05 23:12collazoandy4Note Added: 0096430
2017-05-11 19:46hgbotCheckin
2017-05-11 19:46hgbotNote Added: 0096538
2017-05-11 19:46hgbotStatusscheduled => resolved
2017-05-11 19:46hgbotResolutionopen => fixed
2017-05-11 19:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/7ea7f150342767534c16da2ccf25016adbb7cb5b [^]
2017-05-11 19:47aferrazReview Assigned To => aferraz
2017-05-11 19:47aferrazNote Added: 0096541
2017-05-11 19:47aferrazStatusresolved => closed
2017-05-11 19:47aferrazFixed in Version => 3.0PR17Q3
2017-05-12 13:11hgbotCheckin
2017-05-12 13:11hgbotNote Added: 0096563
2017-05-12 13:14aferrazNote Edited: 0096541bug_revision_view_page.php?bugnote_id=0096541#r15159
2017-05-12 13:19aferrazNote Added: 0096564
2017-05-29 17:43hudsonbotCheckin
2017-05-29 17:43hudsonbotNote Added: 0096959
2017-05-29 17:43hudsonbotCheckin
2017-05-29 17:43hudsonbotNote Added: 0096963

Notes
(0096430)
collazoandy4   
2017-05-05 23:12   
As group admin role:
   Go to Product window and create a new record:
     Organization: F&B España, S.A.
     Search Key/Name: Product
   Go to Goods Receipt and create a new record:
     Organization: F&B España, S.A.
     Business Partner: Bebidas Alegres, S.L.
     Warehouse: España Región Norte
     Create a new record in Lines tab:
       Product: Product
       Movement Quantity: 10
     Complete the receipt
   Create another Goods Receipt record:
     Organization: F&B España, S.A.
     Business Partner: Bebidas Alegres, S.L.
     Warehouse: España Región Sur
     Create a new record in Lines tab:
       Product: Product
       Movement Quantity: 15
     Complete the receipt
   Go to Goods Shipment window and create a new record:
     Organization: F&B España - Región Norte
     Business Partner: Alimentos y Supermercados, S.A
     Warehouse: España Región Norte
     Create a new record in Lines tab:
       Product: Product
       Movement Quantity: 5
     Complete the shipment
   Go to Role window and create a new record:
     Name: Role
     User Level: Client+Organization
     Remove all organizations acces lines except F&B España Region Sur
     Create a new record in User Assigment tab:
       User/Contact: Openbravo
   Log out and log in
   Select the previously created role
   Launch the Stock Report and filter by the previously created product
   Check the stock in España Region Norte warehouses is not shown
(0096538)
hgbot   
2017-05-11 19:46   
Repository: erp/devel/pi
Changeset: 7ea7f150342767534c16da2ccf25016adbb7cb5b
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Fri May 05 17:05:02 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/7ea7f150342767534c16da2ccf25016adbb7cb5b [^]

Fixes issue 35899: Stock Report shows stocks from org that don't have access

The Stock Report shown stocks from warehouse's that belong to an organization that the user
don't have access because the query doesn't filter by the warehouse organization

Now the records of M_LOCATOR are filtered by the natural tree of the organization the
user has access to.

---
M src/org/openbravo/erpCommon/ad_reports/ReportWarehousePartner_data.xsql
---
(0096541)
aferraz   
2017-05-11 19:47   
(edited on: 2017-05-12 13:14)
Test plan II:

As group admin role:
   Create a new product for F&B España, S.A.
   Create a new warehouse and storage bin for F&B España, S.A.
   Create a Goods Receipt for España Norte and receive the previously created product in the previously created storage bin.
   Create a new advanced role
   Assign it to Openbravo user
   Remove the access to all the organizations except F&B España Region Sur
   Log out and log in
   Select the previously created role
   Launch the Stock Report and filter by the previously created product
   Check the stock in new warehouse is shown as it belongs to F&B España, S.A. organization, which is in the natural tree of F&B España Region Sur organization.

(0096563)
hgbot   
2017-05-12 13:11   
Repository: erp/devel/pi
Changeset: 7db0e715083badf6c02bcdab8439ed0e81c66723
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri May 12 13:11:06 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/7db0e715083badf6c02bcdab8439ed0e81c66723 [^]

Related to issue 35899: Code review improvements

Do not filter m_transaction records by the organization natural tree.
Only m_locator records will be filtered by the organization natural tree.

---
M src/org/openbravo/erpCommon/ad_reports/ReportWarehousePartner_data.xsql
---
(0096564)
aferraz   
2017-05-12 13:19   
Code review + Testing OK
(0096959)
hudsonbot   
2017-05-29 17:43   
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/1ee70113bdc4 [^]
Maturity status: Test
(0096963)
hudsonbot   
2017-05-29 17:43   
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/1ee70113bdc4 [^]
Maturity status: Test