添加表面工艺服务产品验证

This commit is contained in:
jinling.yang
2024-08-09 11:31:30 +08:00
parent 41efe81119
commit 34e858ffe4
3 changed files with 11 additions and 4 deletions

View File

@@ -755,7 +755,9 @@ class ResProductMo(models.Model):
# 产品名称唯一性校验
for item in templates:
if len(self.search([('name', '=', item.name)])) > 1:
raise ValidationError('产品名称【%s】已存在' % item.name)
raise UserError('产品名称【%s】已存在' % item.name)
if len(self.search([('server_product_process_parameters_id', '=', item.server_product_process_parameters_id)])) > 1:
raise UserErro('表面工艺参数为【%s】的产品已存在' % item.server_product_process_parameters_id.name)
if "create_product_product" not in self._context:
templates._create_variant_ids()