[FIX] mrp: fix bad workorder-move link
Workorder _action_confirm works in batch and is designed to link workorders and moves per production. Original code breaks the 'per production' constraint by linking moves from all productions to workorders of the last one when called on workorders from multiple productions. closes odoo/odoo#86698 Task: 2797201 X-original-commit: b25f1e005987641a208de30162808005ad6e705a Signed-off-by: Arnold Moyaux <arm@odoo.com>
This commit is contained in:
@@ -462,7 +462,7 @@ class MrpWorkorder(models.Model):
|
||||
bom = self.env['mrp.bom']
|
||||
moves = production.move_raw_ids | production.move_finished_ids
|
||||
|
||||
for workorder in self:
|
||||
for workorder in workorders:
|
||||
bom = workorder.operation_id.bom_id or workorder.production_id.bom_id
|
||||
previous_workorder = workorders_by_bom[bom][-1:]
|
||||
previous_workorder.next_work_order_id = workorder.id
|
||||
|
||||
Reference in New Issue
Block a user