diff --git a/ext/custom-addons/dp_custom/models/product.py b/ext/custom-addons/dp_custom/models/product.py index 32f02904..1d5db32c 100644 --- a/ext/custom-addons/dp_custom/models/product.py +++ b/ext/custom-addons/dp_custom/models/product.py @@ -80,6 +80,8 @@ class ProductTemplate(models.Model): vals = self.correct_values(vals) product_template = self.with_context(active_test=False).search([('default_code', '=', vals['default_code'])]) if product_template: + # default_code may not be changed if there is already an inventory_line (in other company), so we remove it from the dict + vals.pop('default_code',None) product_template.write(vals) else: if vals['active']: