diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index f7673dcd..539f0bdd 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -105,7 +105,10 @@ class ResMrpWorkOrder(models.Model): record.back_button_display = False # 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 !='重新加工' + detection_result.processing_panel == cur_workorder.processing_panel and + detection_result.routing_type == cur_workorder.routing_type and + cur_workorder.tag_type !='重新加工' and + detection_result.test_results != '合格' for detection_result in cur_workorder.production_id.detection_result_ids ): record.back_button_display = False @@ -118,7 +121,10 @@ class ResMrpWorkOrder(models.Model): else: record.back_button_display = False 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 !='重新加工' + detection_result.processing_panel == cur_workorder.processing_panel and + detection_result.routing_type == cur_workorder.routing_type and + cur_workorder.tag_type !='重新加工' and + detection_result.test_results != '合格' for detection_result in cur_workorder.production_id.detection_result_ids ): record.back_button_display = False