From 69cb1adc3eb6f4bc23691d6999cd69c5eca0ea1b Mon Sep 17 00:00:00 2001
From: yuxianghui <1608204036@qq.com>
Date: Thu, 29 Jun 2023 15:56:08 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E5=88=80=E5=85=B7=E7=BB=84=E8=A3=85=E7=9A=84=E5=87=BA=E5=BA=93?=
=?UTF-8?q?=E5=BC=B9=E7=AA=97=E9=87=8C=E7=9A=84=E7=A1=AE=E5=AE=9A=E3=80=81?=
=?UTF-8?q?=E5=8F=96=E6=B6=88=E6=8C=89=E9=94=AE=E7=9A=84=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9ECAM=E8=A3=85=E5=88=80=E6=9D=A5?=
=?UTF-8?q?=E6=BA=90=E7=9A=84=E4=BB=BB=E5=8A=A1=E5=87=BA=E5=BA=93=E5=90=8E?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9CAM=E7=94=A8=E5=88=80=E8=AE=A1=E5=88=92?=
=?UTF-8?q?=E7=9A=84=E7=8A=B6=E6=80=81=E6=94=B9=E5=8F=98=E4=B8=BA=E5=B7=B2?=
=?UTF-8?q?=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_tool_management/models/base.py | 4 ++--
sf_tool_management/wizard/wizard.py | 13 +++++++++++++
sf_tool_management/wizard/wizard_view.xml | 9 +++++----
3 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py
index 03815d6e..183a7020 100644
--- a/sf_tool_management/models/base.py
+++ b/sf_tool_management/models/base.py
@@ -251,7 +251,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
required_cutting_time = fields.Char(string='需要切割时间')
whether_standard_tool = fields.Boolean(string='是否标准刀')
need_knife_time = fields.Datetime(string='需要用刀时间')
- plan_execute_status = fields.Selection([('0', '待下发'), ('1', '执行中'), ('2', '已完成')], string='计划执行状态')
+ plan_execute_status = fields.Selection([('0', '待下发'), ('1', '执行中'), ('2', '已完成')], string='计划执行状态', default='0')
applicant = fields.Char(string='申请人')
reason_for_applying = fields.Char(string='申请原因')
remark = fields.Char(string='备注说明')
@@ -383,7 +383,7 @@ class FunctionalToolAssembly(models.Model):
"""
self.env['sf.delivery.of.cargo.from.storage'].search([]).unlink()
- vals = self.env['sf.functional.tool.assembly'].search([('check_box', '=', True),('assemble_status', '=', '1')])
+ vals = self.env['sf.functional.tool.assembly'].search([('check_box_1', '=', True),('assemble_status', '=', '1')])
if vals:
for val in vals:
diff --git a/sf_tool_management/wizard/wizard.py b/sf_tool_management/wizard/wizard.py
index 373f349f..4bb32b60 100644
--- a/sf_tool_management/wizard/wizard.py
+++ b/sf_tool_management/wizard/wizard.py
@@ -250,3 +250,16 @@ class DeliveryOfCargoFromStorage(models.TransientModel):
'receive_person': self.env.user.name,
'receive_time': fields.Datetime.now()
})
+
+ tool_assembly = self.env['sf.functional.tool.assembly'].search([
+ ('functional_tool_code', '=', val.functional_tool_code),
+ ('functional_tool_name', '=', val.functional_tool_name)
+ ])
+ # 判断装刀任务来源,如果来源于CAM装刀,则修改CAM装刀的计划执行状态
+ if tool_assembly.loading_task_source == '0':
+ self.env['sf.cam.work.order.program.knife.plan'].search([
+ ('functional_tool_code', '=', val.functional_tool_code),
+ ('functional_tool_name', '=', val.functional_tool_name)
+ ]).write({
+ 'plan_execute_status': '2'
+ })
diff --git a/sf_tool_management/wizard/wizard_view.xml b/sf_tool_management/wizard/wizard_view.xml
index 59f4c6dc..e99f61ed 100644
--- a/sf_tool_management/wizard/wizard_view.xml
+++ b/sf_tool_management/wizard/wizard_view.xml
@@ -281,11 +281,12 @@
+
+
+
+
-
+