diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index df303c9c..f8475338 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1553,7 +1553,8 @@ class ResMrpWorkOrder(models.Model): lambda wo: wo.is_subcontract == True and wo.state != 'cancel').sorted('sequence') if self == subcontract_workorders[-1]: # 给下一个库存移动就绪 - self.move_subcontract_workorder_ids[0].move_dest_ids._action_done() + if self.move_subcontract_workorder_ids: + self.move_subcontract_workorder_ids[0].move_dest_ids._action_done() # self.production_id.button_mark_done() tem_date_planned_finished = record.date_planned_finished tem_date_finished = record.date_finished