From 75460c5df6784c4ea4c3a071d21d24f5e50d5693 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Thu, 20 Feb 2025 15:38:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95=20?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index b074746f..d6c97eff 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -166,7 +166,11 @@ class ResMrpWorkOrder(models.Model): ('state', '!=', 'cancel') ]) moves.state = 'assigned' - move_lines.state = 'assigned' + external_assistance = move_lines.filtered( + lambda picking: picking.location_id.name != '外协线边仓' + ) + external_assistance.state = 'assigned' + # move_lines.state = 'assigned' self.time_ids.date_end = None cur_workorder.state = 'progress' cur_workorder.production_id.state = 'progress' @@ -182,6 +186,8 @@ class ResMrpWorkOrder(models.Model): finished_quants.quantity = 0 finish_move = next((move for move in moves if move.location_dest_id.name == '制造后'), None) finish_move.move_dest_ids.reserved_availability = 0 + finish_move.move_dest_ids.move_line_ids.state = 'draft' + finish_move.move_dest_ids.move_line_ids.unlink() # finish_move.move_dest_ids.move_line_ids.reserved_uom_qty = 0 else: next_workorder = sorted_workorders[position + 1]