1、优化返工按钮;2、优化工单状态;

This commit is contained in:
yuxianghui
2024-11-22 17:57:18 +08:00
parent 77ce078e91
commit 3f276f4177
3 changed files with 13 additions and 16 deletions

View File

@@ -51,18 +51,6 @@ class ReworkWizard(models.TransientModel):
self.workorder_id.button_finish()
else:
if self.workorder_ids:
# handle_result = self.production_id.detection_result_ids.filtered(
# lambda dr: dr.handle_result == '待处理')
# if handle_result:
# processing_panels_to_handle = set(handle_item.processing_panel for handle_item in handle_result)
# processing_panels_choice = set(dr_panel.name for dr_panel in self.processing_panel_id)
# # 使用集合的差集操作找出那些待处理结果中有但实际可用加工面中没有的加工面
# processing_panels_missing = processing_panels_to_handle - processing_panels_choice
# # 存在不一致的加工面
# if processing_panels_missing:
# processing_panels_str = ','.join(processing_panels_missing)
# raise UserError('您还有待处理的检测结果中为%s的加工面未选择' % processing_panels_str)
rework_workorder_ids = self.production_id.workorder_ids.filtered(
lambda ap: ap.id in self.workorder_ids.ids)
clamp_workorder_ids = None
@@ -87,8 +75,9 @@ class ReworkWizard(models.TransientModel):
(item.route_id.name == work.name and item.panel
and item.panel == work.processing_panel))
if route:
workorders_values.append(
self.env['mrp.workorder'].json_workorder_str(self.production_id, route[0]))
work_list = self.env['mrp.workorder'].json_workorder_str(self.production_id, route[0])
work_list[2].update({'tag_type': '重新加工'})
workorders_values.append(work_list)
# 创建新工单,并进行返工配置的相关操作
if workorders_values:
# 创建新工单、工序排序、完成检测结果单据