This commit is contained in:
jinling.yang
2024-08-09 10:39:48 +08:00
parent 4399700c3d
commit 5f9c5961a5
4 changed files with 10 additions and 4 deletions

View File

@@ -187,6 +187,9 @@ class MrpProduction(models.Model):
production.state = 'rework'
if any(wo.test_results == '报废' and wo.state == 'done' for wo in production.workorder_ids):
production.state = 'scrap'
if any(dr.test_results == '报废' and dr.handle_result == '已处理' for dr in
production.detection_result_ids):
production.state = 'cancel'
# 如果制造订单的功能刀具为【无效刀】则制造订单状态改为返工
if production.tool_state == '2':
production.state = 'rework'