添加表面工艺服务产品验证
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user