调整工单状态改变逻辑

This commit is contained in:
mgw
2025-02-17 17:34:54 +08:00
parent 732c2089b9
commit 9fce93e1ef

View File

@@ -1087,7 +1087,8 @@ class ResMrpWorkOrder(models.Model):
if (workorder.production_id.production_type == '人工线下加工'
and workorder.production_id.schedule_state == '已排'
and len(workorder.production_id.picking_ids.filtered(
lambda w: w.state not in ['done', 'cancel'])) == 0):
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':