Skip to content
Snippets Groups Projects
Commit a5342daf authored by William Henrotin's avatar William Henrotin
Browse files

[FIX] mrp: missing move reference

A manufacturing order creates its raw move in an onchange when saving the form
view. As the MO has no name at this stage, the raw moves reference stay 'New'
even when marked as done
This commit change the moves reference once the MO is confirmed
parent f3f9dd8c
No related branches found
No related tags found
No related merge requests found
......@@ -605,7 +605,8 @@ class MrpProduction(models.Model):
for move_raw in production.move_raw_ids:
move_raw.write({
'group_id': production.procurement_group_id.id,
'unit_factor': move_raw.product_uom_qty / production.product_qty
'unit_factor': move_raw.product_uom_qty / production.product_qty,
'reference': self.name, # set reference when MO name is different than 'New'
})
production._generate_finished_moves()
production.move_raw_ids._adjust_procure_method()
......
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