From 4115bbb05e59b4086e6734766c5d4bfb2ac3286d Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 28 Mar 2024 17:30:16 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=88=80=E5=85=B7=E5=AE=89=E5=85=A8=E5=BA=93=E5=AD=98=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=9B=B4=E6=96=B0=E6=97=B6=E6=B2=A1=E6=9C=89=E5=8F=8A?= =?UTF-8?q?=E6=97=B6=E6=B3=A8=E5=86=8C=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_tool_management/models/base.py | 8 -------- sf_tool_management/models/functional_tool_enroll.py | 6 ++++++ sf_tool_management/wizard/wizard.py | 1 + 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py index 8e25ae1f..766bb8a9 100644 --- a/sf_tool_management/models/base.py +++ b/sf_tool_management/models/base.py @@ -471,14 +471,6 @@ class RealTimeDistributionOfFunctionalTools(models.Model): records = super(RealTimeDistributionOfFunctionalTools, self).create(vals_list) return records - def write(self, vals): - res = super().write(vals) - for item in self: - if item: - if vals.get('min_stock_num') or vals.get('max_stock_num'): - item.enroll_functional_tool_real_time_distribution() - return res - class MachineTableToolChangingApply(models.Model): _name = 'sf.machine.table.tool.changing.apply' diff --git a/sf_tool_management/models/functional_tool_enroll.py b/sf_tool_management/models/functional_tool_enroll.py index c1687cde..d762c865 100644 --- a/sf_tool_management/models/functional_tool_enroll.py +++ b/sf_tool_management/models/functional_tool_enroll.py @@ -362,3 +362,9 @@ class RealTimeDistributionFunctionalTools(models.Model): if record: record.enroll_functional_tool_real_time_distribution() return records + + def write(self, vals): + res = super().write(vals) + if vals.get('sf_functional_cutting_tool_entity_ids') or vals.get('min_stock_num') or vals.get('max_stock_num'): + self.enroll_functional_tool_real_time_distribution() + return res diff --git a/sf_tool_management/wizard/wizard.py b/sf_tool_management/wizard/wizard.py index 25fcdde9..dbece7b7 100644 --- a/sf_tool_management/wizard/wizard.py +++ b/sf_tool_management/wizard/wizard.py @@ -540,6 +540,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel): return { 'barcode_id': stock_lot.id, 'code': self.tool_code, + 'name': self.after_assembly_functional_tool_name, 'rfid': self.rfid, 'tool_groups_id': self.tool_groups_id.id, 'integral_code_id': self.integral_code_id.id,