[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
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user