From 326aa71aa0dcc5105a14e08bd6c93b61160ae018 Mon Sep 17 00:00:00 2001 From: robinkeunen Date: Fri, 8 Jun 2018 15:29:34 +0200 Subject: [PATCH] [FIX] compute total_with_vat_by_unit separately --- beesdoo_product/models/beesdoo_product.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/beesdoo_product/models/beesdoo_product.py b/beesdoo_product/models/beesdoo_product.py index 0bd6622..9ac28a1 100644 --- a/beesdoo_product/models/beesdoo_product.py +++ b/beesdoo_product/models/beesdoo_product.py @@ -94,14 +94,14 @@ class BeesdooProduct(models.Model): raise_if_not_found=False) 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 return True 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_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: