cnc校验刀无效刀创建检测结果时先检测是否已经存在待处理记录
This commit is contained in:
@@ -95,16 +95,20 @@ class CNCprocessing(models.Model):
|
|||||||
# tool_state_remark1 = f'{key}无效刀:{data1.get(key)}'
|
# tool_state_remark1 = f'{key}无效刀:{data1.get(key)}'
|
||||||
# 无效刀处理逻辑
|
# 无效刀处理逻辑
|
||||||
# 1、创建制造订单无效刀检测结果记录
|
# 1、创建制造订单无效刀检测结果记录
|
||||||
logging.info('创建制造订单无效刀检测结果记录!')
|
if not production_id.detection_result_ids.filtered(
|
||||||
production_id.detection_result_ids.create({
|
lambda a: (a.processing_panel == key and a.detailed_reason == '无效功能刀具'
|
||||||
'production_id': production_id.id,
|
and a.handle_result == '待处理' and a.routing_type == 'CNC加工'
|
||||||
'processing_panel': key,
|
and a.rework_reason == 'programming' and a.test_results == '返工')):
|
||||||
'routing_type': 'CNC加工',
|
logging.info('创建制造订单无效刀检测结果记录!')
|
||||||
'rework_reason': 'programming', # 原因:编程(programming)
|
production_id.detection_result_ids.create({
|
||||||
'detailed_reason': '无效功能刀具',
|
'production_id': production_id.id,
|
||||||
'test_results': '返工',
|
'processing_panel': key,
|
||||||
'handle_result': '待处理'
|
'routing_type': 'CNC加工',
|
||||||
})
|
'rework_reason': 'programming', # 原因:编程(programming)
|
||||||
|
'detailed_reason': '无效功能刀具',
|
||||||
|
'test_results': '返工',
|
||||||
|
'handle_result': '待处理'
|
||||||
|
})
|
||||||
# 修改当前面装夹预调工单的 is_rework 为 True
|
# 修改当前面装夹预调工单的 is_rework 为 True
|
||||||
# work_ids = production_id.workorder_ids.filtered(
|
# work_ids = production_id.workorder_ids.filtered(
|
||||||
# lambda a: a.routing_type == '装夹预调' and a.processing_panel == key and not a.is_rework)
|
# lambda a: a.routing_type == '装夹预调' and a.processing_panel == key and not a.is_rework)
|
||||||
|
|||||||
Reference in New Issue
Block a user