Accept Merge Request #1646: (feature/无效刀自动返工优化 -> develop)

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

Created By: @禹翔辉
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1646
This commit is contained in:
禹翔辉
2024-12-26 13:25:05 +08:00
committed by Coding

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 = []