取消制造订单功能刀具状态为无效刀时自动返工修改制造订单的状态;

This commit is contained in:
yuxianghui
2024-12-26 13:24:04 +08:00
parent 8abb6447d2
commit 40865b7c6c

View File

@@ -372,14 +372,10 @@ class MrpProduction(models.Model):
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'
if production.workorder_ids and all(wo_state in ('done', 'rework', 'cancel') for wo_state in production.workorder_ids.mapped('state')):
if production.state not in ['scrap', 'rework', 'cancel']:
production.state = 'done'
# 退回调整
def technology_back_adjust(self):
process_parameters = []