From 0183a5ab2b42106876d674ffd78eaf465b861f58 Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Tue, 20 Feb 2024 14:27:43 +0800
Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E5=88=80=E5=85=B7=E7=BB=84=E8=A3=85=E6=A8=A1=E5=9E=8B=E7=9A=84?=
=?UTF-8?q?=E6=89=93=E5=8D=B0=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=8C=89=E9=92=AE?=
=?UTF-8?q?=EF=BC=8C=E9=9A=90=E8=97=8F=E7=BB=84=E8=A3=85=E5=8D=95=E6=89=93?=
=?UTF-8?q?=E5=8D=B0=E6=8C=89=E9=92=AE=EF=BC=9B2=E3=80=81=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E5=8A=9F=E8=83=BD=E5=88=80=E5=85=B7=E7=BB=84=E8=A3=85?=
=?UTF-8?q?=E6=97=B6=E7=9A=84rfid=E9=AA=8C=E9=87=8D=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_tool_management/models/base.py | 12 ------------
sf_tool_management/views/tool_base_views.xml | 20 ++++++++------------
sf_tool_management/wizard/wizard.py | 15 +++++++++++++++
3 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py
index b55d7003..51ac861d 100644
--- a/sf_tool_management/models/base.py
+++ b/sf_tool_management/models/base.py
@@ -956,18 +956,6 @@ class FunctionalToolAssembly(models.Model):
return functional_tool
return False
- def automated_assembly(self):
- """
- todo 自动组装
- :return:
- """
-
- def automatic_printing_of_QR_code(self):
- """
- todo 自动打印二维码
- :return:
- """
-
def assemble_single_print(self):
"""
todo 组装单打印
diff --git a/sf_tool_management/views/tool_base_views.xml b/sf_tool_management/views/tool_base_views.xml
index 59229492..2d5cdf63 100644
--- a/sf_tool_management/views/tool_base_views.xml
+++ b/sf_tool_management/views/tool_base_views.xml
@@ -967,10 +967,10 @@
}"
attrs="{'invisible': [('assemble_status', '!=', '0')]}" groups="sf_base.group_sf_mrp_user"
class="btn-primary"/>
-
+
+
+
+
@@ -1006,14 +1006,10 @@
attrs="{'invisible': [('assemble_status', '!=', '0')]}"
class="btn-primary"/>
-
-
+
+
+
+
diff --git a/sf_tool_management/wizard/wizard.py b/sf_tool_management/wizard/wizard.py
index 9f4e075e..3b2649a2 100644
--- a/sf_tool_management/wizard/wizard.py
+++ b/sf_tool_management/wizard/wizard.py
@@ -445,6 +445,21 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if obj.after_assembly_functional_tool_length == 0:
raise ValidationError('组装参数信息【伸出长】不能为0!!!')
+ @api.constrains('rfid')
+ def _check_rfid(self):
+ self.get_rfid()
+
+ @api.onchange('rfid')
+ def _onchange_rfid(self):
+ self.get_rfid()
+
+ def get_rfid(self):
+ for obj in self:
+ if obj.rfid:
+ tool_entity = self.env['sf.functional.cutting.tool.entity'].sudo().search([('rfid', '=', obj.rfid)])
+ if tool_entity:
+ raise ValidationError('【%s】的rfid已被使用,请重新录入!!!' % obj.rfid)
+
def functional_tool_assembly(self):
"""
功能刀具组装