LaOsaCoop/Odoo16#6 product_sale_price_from_pricelist: raise an error when no taxes configured in product
This commit is contained in:
parent
80cc00c873
commit
bf582e5081
1 changed files with 8 additions and 1 deletions
|
|
@ -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,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue