制造订单是返工状态时-上报返工的工单有【回退】入口-要隐藏问题处理

This commit is contained in:
liaodanlong
2025-02-25 16:31:18 +08:00
parent 2e648dea4e
commit a0c5f9d15f

View File

@@ -103,7 +103,11 @@ class ResMrpWorkOrder(models.Model):
record.back_button_display = True
else:
record.back_button_display = False
if cur_workorder.is_subcontract or cur_workorder.name == '解除装夹':
# tag_type
if cur_workorder.is_subcontract or cur_workorder.name == '解除装夹' or any(
detection_result.processing_panel == cur_workorder.processing_panel and detection_result.routing_type == cur_workorder.routing_type and cur_workorder.tag_type !='重新加工'
for detection_result in cur_workorder.production_id.detection_result_ids
):
record.back_button_display = False
else:
next_workorder = sorted_workorders[position + 1]
@@ -113,7 +117,10 @@ class ResMrpWorkOrder(models.Model):
record.back_button_display = True
else:
record.back_button_display = False
if cur_workorder.is_subcontract or cur_workorder.name == '解除装夹':
if cur_workorder.is_subcontract or cur_workorder.name == '解除装夹' or any(
detection_result.processing_panel == cur_workorder.processing_panel and detection_result.routing_type == cur_workorder.routing_type and cur_workorder.tag_type !='重新加工'
for detection_result in cur_workorder.production_id.detection_result_ids
):
record.back_button_display = False
date_planned_start = fields.Datetime(tracking=True)