Merge branch 'feature/修复工单cnc校验bug_1' into feature/修复工单cnc校验bug_2

This commit is contained in:
yuxianghui
2024-07-24 16:21:40 +08:00

View File

@@ -777,6 +777,8 @@ class ResMrpWorkOrder(models.Model):
if workorder.production_id.is_rework is True: if workorder.production_id.is_rework is True:
if re_work or cnc_workorder: if re_work or cnc_workorder:
workorder.state = 'waiting' workorder.state = 'waiting'
if workorder.production_id.tool_state in ['1', '2'] and workorder.state != 'pending':
workorder.state = 'waiting'
elif workorder.routing_type == 'CNC加工' and workorder.state not in ['done', 'rework', 'cancel']: elif workorder.routing_type == 'CNC加工' and workorder.state not in ['done', 'rework', 'cancel']:
pre_workorder = self.env['mrp.workorder'].search( pre_workorder = self.env['mrp.workorder'].search(