diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index b14955e4..f7673dcd 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1217,10 +1217,9 @@ class ResMrpWorkOrder(models.Model): # ================= 如果制造订单制造类型为【人工线下加工】========================== if (workorder.production_id.production_type == '人工线下加工' and workorder.production_id.schedule_state == '已排' - and workorder.routing_type == '人工线下加工' and len(workorder.production_id.picking_ids.filtered( - lambda w: w.state not in ['done', 'cancel'])) == 0 - and workorder.production_id.programming_state == '已编程'): + lambda w: w.state not in ['done', 'cancel'])) == 0): + # and workorder.production_id.programming_state == '已编程' if workorder.is_subcontract is True: purchase_orders_id = self._get_surface_technics_purchase_ids() if purchase_orders_id.state == 'purchase': @@ -1236,6 +1235,9 @@ class ResMrpWorkOrder(models.Model): else: workorder.state = 'waiting' continue + elif workorder.routing_type == '人工线下加工': + if workorder.production_id.programming_state == '已编程': + workorder.state = 'ready' else: workorder.state = 'ready' continue