From 0a8cc050b87e86c74782ec633b684aa3075e1350 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Wed, 5 Feb 2025 17:41:52 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E7=BA=BF=E4=B8=8B?= =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E5=B7=A5=E5=8D=95=E4=B9=9F=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E8=B5=B0cloud=E7=BC=96=E7=A8=8B=E6=B5=81=E7=A8=8B=E7=9A=84?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 1 + sf_manufacturing/models/stock.py | 2 +- .../views/mrp_production_addional_change.xml | 10 ++++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index d7c6d53d..1a35b251 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -1302,6 +1302,7 @@ class MrpProduction(models.Model): # 对制造订单所以面的cnc工单的程序用刀进行校验 try: logging.info(f'已更新制造订单:{productions_not_delivered}') + productions = productions.env['mrp.production'].search([('production_type', '=', '自动化产线加工')]) productions.production_cnc_tool_checkout() except Exception as e: logging.info(f'对cnc工单的程序用刀进行校验报错:{e}') diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index d19d7f92..986173f1 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -289,7 +289,7 @@ class StockRule(models.Model): if production_item.product_id.id in product_id_to_production_names: # 同一个产品多个制造订单对应一个编程单和模型库 # 只调用一次fetchCNC,并将所有生产订单的名称作为字符串传递 - if not production_item.programming_no and production_item.production_type == '自动化产线加工': + if not production_item.programming_no and production_item.production_type in ['自动化产线加工', '人工线下加工']: if not production_programming.programming_no: production_item.fetchCNC( ', '.join(product_id_to_production_names[production_item.product_id.id])) diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml index d71ba4a5..18d42f70 100644 --- a/sf_manufacturing/views/mrp_production_addional_change.xml +++ b/sf_manufacturing/views/mrp_production_addional_change.xml @@ -74,7 +74,9 @@ 1 - + + + @@ -115,11 +117,11 @@ + attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工'])]}"/> + attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工'])]}"/> From 978e4277341b37c524345b85594767eaea4b570e Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Wed, 5 Feb 2025 17:44:32 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=B6=E9=80=A0?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=9B=86=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 0d4ca196..19e912d1 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -1305,7 +1305,7 @@ class MrpProduction(models.Model): # 对制造订单所以面的cnc工单的程序用刀进行校验 try: logging.info(f'已更新制造订单:{productions_not_delivered}') - productions = productions.env['mrp.production'].search([('production_type', '=', '自动化产线加工')]) + productions = productions.filtered(lambda p: p.production_type == '自动化产线加工') productions.production_cnc_tool_checkout() except Exception as e: logging.info(f'对cnc工单的程序用刀进行校验报错:{e}') From 88840abf9f824742e83e47cb712b02ee6eff7fe0 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Sat, 8 Feb 2025 13:32:40 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=BC=96=E7=A8=8B=E7=8A=B6=E6=80=81=E6=90=9C=E7=B4=A2=E7=9A=84?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/views/mrp_production_addional_change.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml index 18d42f70..04a51450 100644 --- a/sf_manufacturing/views/mrp_production_addional_change.xml +++ b/sf_manufacturing/views/mrp_production_addional_change.xml @@ -632,6 +632,8 @@ + + From 44f29d001e4e5f07601d40f36490b0e48a26a84c Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Sat, 8 Feb 2025 14:08:53 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BA=BA=E5=B7=A5?= =?UTF-8?q?=E7=BA=BF=E4=B8=8B=E5=8A=A0=E5=B7=A5=E9=A1=B5=E9=9D=A2=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/views/mrp_workorder_view.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index 3dba032c..945632f1 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -493,7 +493,7 @@ - + @@ -565,7 +565,7 @@ - + @@ -589,7 +589,7 @@ - + @@ -642,7 +642,7 @@ - +