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] =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E7=BA=BF=E4=B8=8B=E5=8A=A0?=
=?UTF-8?q?=E5=B7=A5=E5=B7=A5=E5=8D=95=E4=B9=9F=E9=9C=80=E8=A6=81=E8=B5=B0?=
=?UTF-8?q?cloud=E7=BC=96=E7=A8=8B=E6=B5=81=E7=A8=8B=E7=9A=84=E4=BC=98?=
=?UTF-8?q?=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', ['自动化产线加工', '人工线下加工'])]}"/>