-
-
Notifications
You must be signed in to change notification settings - Fork 266
Description
Module
stock_operating_unit
Describe the bug
When attempting an inter-warehouse transfer (replenishment) between two warehouses belonging to different Operating Units (OU), users encounter Access Errors in two specific stages.
- Replenishment Creation: A user assigned to the destination OU cannot create a replenishment rule that pulls from a source warehouse in a different OU (Access Error on
stock.warehouse/stock.location). - Transfer Validation: A user assigned to the source OU cannot validate the outgoing delivery order because it is linked to a move in the destination OU (Access Error on
stock.move).
The strict record rules seem to prevent the cross-OU access required for the standard "Resupply from Warehouse" route to function.
To Reproduce
Affected versions: 18.0
Steps to reproduce the behavior:
1. Setup Configuration:
- Operating Units: Create
Main OUandSecond OU. - Warehouses:
WH(My Company) -> Assigned toMain OU.WH2(Second Warehouse) -> Assigned toSecond OU.
- Users:
User 1: Assigned toMain OU. Role: Inventory Administrator.User 2: Assigned toSecond OU. Role: Inventory Administrator.
- Routes: Configure a product with the "Supply Product from My Company" route (pulling from
WHto supplyWH2).
2. Scenario A (Creation Failure):
- Log in as
User 2(Second OU). - Go to Replenishment and attempt to create a manual orderpoint for the product in
WH2(triggering a pull fromWH). - Result: The system raises an Access Error for
stock.warehouse.
3. Scenario B (Validation Failure):
- (Workaround) Log in as
Adminand create the replenishment rule for User 2. This generates a Delivery Order inWHand a Receipt inWH2. - Log in as
User 1(Main OU). - Open the Delivery Order in
WHand click Validate. - Result: The system raises an Access Error for
stock.move.
Expected behavior
- User 2 should be able to trigger a replenishment for their own warehouse (
WH2), even if the supply route originates from a different OU (WH). - User 1 should be able to validate the outgoing Delivery Order from their warehouse (
WH), without being blocked by the linked move in the destination OU.
Additional context
Error Log (Scenario A - User 2):
Uh-oh! Looks like you have stumbled upon some top-secret records. Sorry, User 2 (id=7) doesn't have 'read' access to: - Warehouse (stock.warehouse)
Error Log (Scenario B - User 1):
Uh-oh! Looks like you have stumbled upon some top-secret records. Sorry, User 1 (id=6) doesn't have 'read' access to: - Stock Move (stock.move)