[14.0][FIX] mrp_multi_level: error with 3 step delivery.

If the destination moves do not include a MO, the mrp move end
up without a name that raises an error later. This can happen
with 3 setep delivery but also with in more cases in wich there is
a chain of stock moves.

We ensure that the variable `order_number` always have a value.
This commit is contained in:
Lois Rilo
2021-03-24 17:31:21 +01:00
parent 8704652af4
commit dc0f9e7642

View File

@@ -71,7 +71,7 @@ class MultiLevelMrp(models.TransientModel):
parent_product_id = (
move_dest_id.production_id.product_id or move_dest_id.product_id
).id
else:
if not order_number:
order_number = (move.picking_id or move).name
origin = "mv"
mrp_date = date.today()