LaOsaCoop/Odoo16#6 product_sale_price_from_pricelist: raise an error when no taxes configured in product

This commit is contained in:
Luis 2025-07-10 14:12:44 +02:00
parent 80cc00c873
commit bf582e5081

View file

@ -67,7 +67,14 @@ class ProductTemplate(models.Model):
qty=1, pricelist=pricelist qty=1, pricelist=pricelist
) )
# Compute taxes to add # 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, partial_price[template.product_variant_id.id]["value"] or 0.0,
handle_price_include=False, handle_price_include=False,
) )