diff --git a/addons/product/models/product.py b/addons/product/models/product.py index a2acba254ef..6b0c04275bc 100644 --- a/addons/product/models/product.py +++ b/addons/product/models/product.py @@ -314,7 +314,9 @@ class ProductProduct(models.Model): @api.model def create(self, vals): product = super(ProductProduct, self.with_context(create_product_product=True)).create(vals) - product._set_standard_price(vals.get('standard_price', 0.0)) + # When a unique variant is created from tmpl then the standard price is set by _set_standard_price + if not (self.env.context.get('create_from_tmpl') and len(product.product_tmpl_id.product_variant_ids) == 1): + product._set_standard_price(vals.get('standard_price') or 0.0) return product @api.multi diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py index d56aef35cfa..16ac91ce034 100644 --- a/addons/product/models/product_template.py +++ b/addons/product/models/product_template.py @@ -264,7 +264,7 @@ class ProductTemplate(models.Model): tools.image_resize_images(vals) template = super(ProductTemplate, self).create(vals) if "create_product_product" not in self._context: - template.create_variant_ids() + template.with_context(create_from_tmpl=True).create_variant_ids() # This is needed to set given values to first variant after creation related_vals = {}