From ddd902cad898b1fa9265844c2803b82da86b1c8c Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Fri, 18 Apr 2025 16:06:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9B=E5=BB=BA=E8=A1=A8?= =?UTF-8?q?=E9=9D=A2=E5=B7=A5=E8=89=BA=E4=BA=A7=E5=93=81=E6=97=B6=E8=A1=A8?= =?UTF-8?q?=E9=9D=A2=E5=B7=A5=E8=89=BA=E5=8F=82=E6=95=B0=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=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_manufacturing/models/product_template.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 1af6226a..2dd79adb 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -1067,7 +1067,8 @@ class ResProductMo(models.Model): raise UserError('产品名称【%s】已存在' % item.name) if item.categ_type == '表面工艺': if len(self.search([('server_product_process_parameters_id', '=', - item.server_product_process_parameters_id.id)])) > 1: + item.server_product_process_parameters_id.id),('server_product_process_parameters_id', '!=', + False)])) > 1: raise UserError('表面工艺参数为【%s】的产品已存在' % item.server_product_process_parameters_id.name) if "create_product_product" not in self._context: templates._create_variant_ids()