-
- Downloads
[FIX] stock, mrp: inter company transit chained moves
Let's say we have a chain of move wh1 - intercomp transit -> intercomp transit - wh2 The second move will be reserved according to what the first move brought since they are chained. This behavior resulted in rev[0] which tries to work around the ir.rule limiting the access of stock.move and stock.move.line records in multi-company environment. This patch wasn't perfect since, if the first move brought a lot, the second move will reserve this lot and it will result in another access error since the lot will still have the company of the first move. We fix this by implementing the following logic: receiving from another company should behave the same as receiving from the supplier, no reservation is applied. We fix this by marking the inter company transit as `_should_bypass_reservation` and we break the move chain if the pull/push rule create an intercompany chain. [0] 6ff34073 closes odoo/odoo#45601 Task: 2160847 X-original-commit: 67b45da9d877a5a1bb9adb3ce14051e01f67045f Signed-off-by:Simon Lejeune (sle) <sle@openerp.com>
Showing
- addons/mrp/models/stock_move.py 4 additions, 0 deletionsaddons/mrp/models/stock_move.py
- addons/mrp/tests/test_workorder_operation.py 2 additions, 0 deletionsaddons/mrp/tests/test_workorder_operation.py
- addons/stock/models/stock_location.py 1 addition, 1 deletionaddons/stock/models/stock_location.py
- addons/stock/models/stock_move.py 5 additions, 2 deletionsaddons/stock/models/stock_move.py
- addons/stock/models/stock_picking.py 0 additions, 3 deletionsaddons/stock/models/stock_picking.py
- addons/stock/models/stock_production_lot.py 2 additions, 2 deletionsaddons/stock/models/stock_production_lot.py
- addons/stock/models/stock_rule.py 10 additions, 2 deletionsaddons/stock/models/stock_rule.py
- addons/stock/security/stock_security.xml 2 additions, 2 deletionsaddons/stock/security/stock_security.xml
- addons/stock/tests/test_move.py 2 additions, 46 deletionsaddons/stock/tests/test_move.py
- addons/stock/tests/test_multicompany.py 210 additions, 0 deletionsaddons/stock/tests/test_multicompany.py
Loading
Please register or sign in to comment