修复表面工艺外协
This commit is contained in:
@@ -658,7 +658,7 @@ class ResProductMo(models.Model):
|
||||
tax_id = self.env['account.tax'].sudo().search(
|
||||
[('type_tax_use', '=', 'sale'), ('amount', '=', item.get('tax')), ('price_include', '=', 'True')])
|
||||
if tax_id:
|
||||
vals.update({'taxes_id':[(6,0,[int(tax_id)])]})
|
||||
vals.update({'taxes_id': [(6, 0, [int(tax_id)])]})
|
||||
copy_product_id.sudo().write(vals)
|
||||
product_id.product_tmpl_id.active = False
|
||||
return copy_product_id
|
||||
@@ -756,8 +756,10 @@ class ResProductMo(models.Model):
|
||||
for item in templates:
|
||||
if len(self.search([('name', '=', item.name)])) > 1:
|
||||
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 item.categ_type == '表面工艺':
|
||||
if len(self.search([('server_product_process_parameters_id', '=',
|
||||
item.server_product_process_parameters_id.id)])) > 1:
|
||||
raise UserError('表面工艺参数为【%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