Skip to content
Snippets Groups Projects
Commit dc10774d authored by yhu-odoo's avatar yhu-odoo
Browse files

[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: default avatarSimon Lejeune (sle) <sle@openerp.com>
parent 14777745
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment