diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 71cd86b5..0fa86e78 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -116,6 +116,11 @@ class MrpProduction(models.Model): elif production.state == 'to_close' and production.schedule_state == '已排': production.state = 'pending_cam' + if production.state == 'progress': + if all(wo_state not in ('progress', 'done') for wo_state in production.workorder_ids.mapped('state')): + production.state = 'pending_cam' + + def action_check(self): """ 审核启用