Browse Source

[FIX] compute total_with_vat_by_unit separately

pull/40/head
robinkeunen 7 years ago
parent
commit
326aa71aa0
  1. 6
      beesdoo_product/models/beesdoo_product.py

6
beesdoo_product/models/beesdoo_product.py

@ -94,14 +94,14 @@ class BeesdooProduct(models.Model):
raise_if_not_found=False) raise_if_not_found=False)
taxes_included = set(self.taxes_id.mapped('price_include')) taxes_included = set(self.taxes_id.mapped('price_include'))
if len(taxes_included) == 0 or not self.weight:
if len(taxes_included) == 0:
self.total_with_vat = self.list_price self.total_with_vat = self.list_price
return True return True
elif len(taxes_included) > 1: elif len(taxes_included) > 1:
raise ValidationError('Several tax strategies defined for %s' % self.name)
raise ValidationError('Several tax strategies (price_include) defined for %s' % self.name)
if taxes_included.pop():
elif taxes_included.pop():
self.total_with_vat = self.list_price self.total_with_vat = self.list_price
self.total_deposit = sum([tax._compute_amount(self.list_price, self.list_price) for tax in self.taxes_id if tax.tax_group_id == consignes_group]) self.total_deposit = sum([tax._compute_amount(self.list_price, self.list_price) for tax in self.taxes_id if tax.tax_group_id == consignes_group])
else: else:

Loading…
Cancel
Save