mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[FIX] mrp_multi_level: Descriptive order number in MRP Moves
This commit is contained in:
committed by
Lois Rilo
parent
5e7c97ecbc
commit
f56d5247c6
@@ -51,22 +51,25 @@ class MultiLevelMrp(models.TransientModel):
|
|||||||
mrp_type = "s"
|
mrp_type = "s"
|
||||||
product_qty = move.product_qty
|
product_qty = move.product_qty
|
||||||
po = po_line = None
|
po = po_line = None
|
||||||
mo = origin = order_number = parent_product_id = None
|
mo = origin = order_number = order_origin = parent_product_id = None
|
||||||
if move.purchase_line_id:
|
if move.purchase_line_id:
|
||||||
po = move.purchase_line_id.order_id
|
po = move.purchase_line_id.order_id
|
||||||
order_number = po.origin or po.name
|
order_number = po.name
|
||||||
|
order_origin = po.origin
|
||||||
origin = "po"
|
origin = "po"
|
||||||
po = move.purchase_line_id.order_id.id
|
po = move.purchase_line_id.order_id.id
|
||||||
po_line = move.purchase_line_id.id
|
po_line = move.purchase_line_id.id
|
||||||
elif move.production_id or move.raw_material_production_id:
|
elif move.production_id or move.raw_material_production_id:
|
||||||
production = move.production_id or move.raw_material_production_id
|
production = move.production_id or move.raw_material_production_id
|
||||||
order_number = production.origin or production.name
|
order_number = production.name
|
||||||
|
order_origin = production.origin
|
||||||
origin = "mo"
|
origin = "mo"
|
||||||
mo = production.id
|
mo = production.id
|
||||||
elif move.move_dest_ids:
|
elif move.move_dest_ids:
|
||||||
for move_dest_id in move.move_dest_ids.filtered("production_id"):
|
for move_dest_id in move.move_dest_ids.filtered("production_id"):
|
||||||
production = move_dest_id.production_id
|
production = move_dest_id.production_id
|
||||||
order_number = production.origin or production.name
|
order_number = production.name
|
||||||
|
order_origin = production.origin
|
||||||
origin = "mo"
|
origin = "mo"
|
||||||
mo = move_dest_id.production_id.id
|
mo = move_dest_id.production_id.id
|
||||||
parent_product_id = (
|
parent_product_id = (
|
||||||
@@ -99,7 +102,7 @@ class MultiLevelMrp(models.TransientModel):
|
|||||||
"mrp_order_number": order_number,
|
"mrp_order_number": order_number,
|
||||||
"parent_product_id": parent_product_id,
|
"parent_product_id": parent_product_id,
|
||||||
"name": order_number,
|
"name": order_number,
|
||||||
"origin": order_number,
|
"origin": order_origin,
|
||||||
"state": move.state,
|
"state": move.state,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user