Browse Source

[FIX] case when taxes_id is not set

pull/40/head
robinkeunen 7 years ago
parent
commit
989b62dd34
  1. 7
      beesdoo_product/models/beesdoo_product.py

7
beesdoo_product/models/beesdoo_product.py

@ -94,7 +94,12 @@ 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) > 1:
if len(taxes_included) == 0 or not self.weight:
self.total_with_vat = self.list_price
self.total_with_vat_by_unit = self.total_with_vat / self.weight
return True
elif len(taxes_included) > 1:
raise ValidationError('Several tax strategies defined for %s' % self.name) raise ValidationError('Several tax strategies defined for %s' % self.name)
if taxes_included.pop(): if taxes_included.pop():

Loading…
Cancel
Save