Skip to content
Snippets Groups Projects
Commit b25f1e00 authored by JF Aubert's avatar JF Aubert
Browse files

[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#86633

Task: 2797201
Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
parent 3080666c
No related branches found
No related tags found
No related merge requests found
......@@ -451,7 +451,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
......
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