From 976d75973df773b777092fa7dc778a682d93fc31 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Sat, 8 Feb 2025 16:00:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=A8=8B=E5=BA=8F=E5=86=99?= =?UTF-8?q?=E5=85=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 4 ++-- sf_mrs_connect/controllers/controllers.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 19e912d1..cd60bce1 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -1295,7 +1295,7 @@ class MrpProduction(models.Model): for rework_item in rework_workorder: pending_workorder = production.workorder_ids.filtered( lambda m1: m1.state in [ - 'pending'] and m1.processing_panel == rework_item.processing_panel and m1.routing_type == 'CNC加工') + 'pending'] and m1.processing_panel == rework_item.processing_panel and m1.routing_type in ['CNC加工', '人工线下加工']) if not pending_workorder.cnc_ids: production.get_new_program(rework_item.processing_panel) # production.write({'state': 'progress', 'programming_state': '已编程', 'is_rework': False}) @@ -1338,7 +1338,7 @@ class MrpProduction(models.Model): if productions: for production in productions: panel_workorder = production.workorder_ids.filtered(lambda - pw: pw.processing_panel == processing_panel and pw.routing_type == 'CNC加工' and pw.state not in ( + pw: pw.processing_panel == processing_panel and pw.routing_type in ['CNC加工', '人工线下加工'] and pw.state not in ( 'rework', 'done')) if panel_workorder: if panel_workorder.cmm_ids: diff --git a/sf_mrs_connect/controllers/controllers.py b/sf_mrs_connect/controllers/controllers.py index 69cc45ca..ba4392ad 100644 --- a/sf_mrs_connect/controllers/controllers.py +++ b/sf_mrs_connect/controllers/controllers.py @@ -103,7 +103,8 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController): try: logging.info(f'已更新制造订单:{productions}') re_tool_chekout = False - re_tool_chekout = productions.production_cnc_tool_checkout() + productions_temp = productions.filtered(lambda p: p.production_type == '自动化产线加工') + re_tool_chekout = productions_temp.production_cnc_tool_checkout() if re_tool_chekout: return json.JSONEncoder().encode({'status': -3, 'message': '对cnc工单的程序用刀进行校验失败'}) except Exception as e: