Accept Merge Request #1367: (feature/无效刀校验优化 -> develop)

Merge Request: cnc校验刀无效刀创建检测结果时先检测是否已经存在待处理记录

Created By: @禹翔辉
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1367?initial=true
This commit is contained in:
禹翔辉
2024-09-27 13:36:44 +08:00
committed by Coding

View File

@@ -95,6 +95,10 @@ class CNCprocessing(models.Model):
# tool_state_remark1 = f'{key}无效刀:{data1.get(key)}'
# 无效刀处理逻辑
# 1、创建制造订单无效刀检测结果记录
if not production_id.detection_result_ids.filtered(
lambda a: (a.processing_panel == key and a.detailed_reason == '无效功能刀具'
and a.handle_result == '待处理' and a.routing_type == 'CNC加工'
and a.rework_reason == 'programming' and a.test_results == '返工')):
logging.info('创建制造订单无效刀检测结果记录!')
production_id.detection_result_ids.create({
'production_id': production_id.id,