diff --git a/product_sale_price_from_pricelist/models/product_template.py b/product_sale_price_from_pricelist/models/product_template.py index 4e831df..8e39ca3 100644 --- a/product_sale_price_from_pricelist/models/product_template.py +++ b/product_sale_price_from_pricelist/models/product_template.py @@ -67,7 +67,14 @@ class ProductTemplate(models.Model): qty=1, pricelist=pricelist ) # Compute taxes to add - tax_price = self.taxes_id.compute_all( + if not template.taxes_id: + raise UserError( + _( + "No taxes defined for product %s. Please define taxes in the product form." + ) + % template.name + ) + tax_price = template.taxes_id.compute_all( partial_price[template.product_variant_id.id]["value"] or 0.0, handle_price_include=False, )