From 9d59917af9063bc961568aee389d7ceee4ba298a Mon Sep 17 00:00:00 2001 From: gqh Date: Thu, 16 Feb 2023 17:48:26 +0800 Subject: [PATCH] =?UTF-8?q?CNC=E8=8E=B7=E5=8F=96=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E8=87=AA=E5=8A=A8=E5=BC=80=E5=A7=8B=20?= =?UTF-8?q?=E5=B9=B6=E8=8E=B7=E5=8F=96cnc=E7=A8=8B=E5=BA=8F=E5=88=B0mrs?= =?UTF-8?q?=E7=BC=96=E7=A8=8B=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 4 ++++ sf_manufacturing/views/mrp_workorder_view.xml | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 4026c061..0e388d20 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -136,6 +136,7 @@ class MrpProduction(models.Model): for workorder in production.workorder_ids: workorder.duration_expected = workorder._get_duration_expected() + #在之前的销售单上重新生成制造订单 def create_production1_values(self, production): production_values_str = {'origin': production.origin, @@ -232,6 +233,9 @@ class MrpProduction(models.Model): for work in rec.workorder_ids: work.sequence = current_sequence current_sequence += 1 + if work.name == '获取CNC加工程序': + work.button_start() + work.fetchCNC() #创建工单并进行排序 def _create_workorder(self): diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index 85ed09f0..2a847788 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -22,13 +22,13 @@ - {'invisible': ['|', '|', '|','|', ('production_state','in', ('draft', 'done', + {'invisible': ['|', '|', '|','|','|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), - ('is_user_working', '!=', False),("user_permissions","=",False)]} + ('is_user_working', '!=', False),("user_permissions","=",False),("name","=","获取CNC加工程序")]} - {'invisible': [("user_permissions","=",False)]} + {'invisible': ['|',("user_permissions","=",False),("name","=","获取CNC加工程序")]} 停工 @@ -103,20 +103,21 @@ +