From 4dd733c466a2fda0683517e2e9dc6c20f8414280 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Sun, 7 Apr 2024 15:35:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1=E3=80=81=E5=A4=84=E7=90=86=E5=88=80?= =?UTF-8?q?=E5=85=B7=E7=89=A9=E6=96=99=E6=B3=A8=E5=86=8C=E6=97=B6=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E4=B8=8D=E5=88=B0=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B?= =?UTF-8?q?2=E3=80=81=E5=8A=9F=E8=83=BD=E5=88=80=E5=85=B7=E7=BB=84?= =?UTF-8?q?=E8=A3=85=E6=97=B6=EF=BC=8C=E5=BD=93=E6=B2=A1=E6=9C=89=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=89=A9=E6=96=99=E7=9A=84=E6=97=B6=E5=80=99=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=88=80=E5=85=B7=E7=BC=96=E7=A0=81=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=95=B0=E6=8D=AE=EF=BC=9B=E6=B7=BB=E5=8A=A0=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E5=AF=BF=E5=91=BD=E5=80=BC=E3=80=81=E6=8A=A5=E8=AD=A6?= =?UTF-8?q?=E5=80=BC=E3=80=81=E6=9C=89=E6=95=88=E9=95=BF=E3=80=81=E9=81=BF?= =?UTF-8?q?=E7=A9=BA=E9=95=BF=E7=9A=84=E5=BF=85=E5=A1=AB=E9=AA=8C=E8=AF=81?= =?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/functional_tool_enroll.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_tool_management/models/functional_tool_enroll.py b/sf_tool_management/models/functional_tool_enroll.py index d762c865..8fb781f8 100644 --- a/sf_tool_management/models/functional_tool_enroll.py +++ b/sf_tool_management/models/functional_tool_enroll.py @@ -40,7 +40,7 @@ class StockLot(models.Model): sf_secret_key = sf_sync_config['sf_secret_key'] headers = Common.get_headers(self, token, sf_secret_key) str_url = sf_sync_config['sf_url'] + "/api/tool_material_stock/create" - objs_all = self.env['stock.lot'].search([('id', '=', self.id)]) + objs_all = self.env['stock.lot'].search([('id', '=', self.id), ('active', 'in', [True, False])]) tool_material_stock_list = [] if objs_all: for item in objs_all: From 000280e53a00362914455e674d7999a85ab519d8 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Sun, 7 Apr 2024 15:36:05 +0800 Subject: [PATCH 2/2] no message --- sf_tool_management/wizard/wizard.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sf_tool_management/wizard/wizard.py b/sf_tool_management/wizard/wizard.py index 285da727..90b8da63 100644 --- a/sf_tool_management/wizard/wizard.py +++ b/sf_tool_management/wizard/wizard.py @@ -413,7 +413,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel): num = self._get_code(str_2) obj.tool_code = str_2 + str(num) else: - obj.tool_code = None + obj.tool_code = '' def _get_code(self, str_2): functional_tool_assembly = self.env['sf.functional.tool.assembly'].sudo().search( @@ -470,13 +470,23 @@ class FunctionalToolAssemblyOrder(models.TransientModel): else: record.L_D_number = 0 - @api.constrains('after_assembly_tool_loading_length', 'after_assembly_functional_tool_length') + @api.constrains('after_assembly_tool_loading_length', 'after_assembly_functional_tool_length', + 'after_assembly_max_lifetime_value', 'after_assembly_alarm_value', + 'after_assembly_effective_length', 'hiding_length') def _check_length_control(self): for obj in self: if obj.after_assembly_tool_loading_length == 0: raise ValidationError('组装参数信息【总长度】不能为0!!!') if obj.after_assembly_functional_tool_length == 0: raise ValidationError('组装参数信息【伸出长】不能为0!!!') + if obj.after_assembly_max_lifetime_value == 0: + raise ValidationError('组装参数信息【最大寿命值】不能为0!!!') + if obj.after_assembly_alarm_value == 0: + raise ValidationError('组装参数信息【报警值】不能为0!!!') + if obj.after_assembly_effective_length == 0: + raise ValidationError('组装参数信息【有效长】不能为0!!!') + if obj.hiding_length == 0: + raise ValidationError('组装参数信息【避空长】不能为0!!!') def functional_tool_assembly(self): """