Prevent issues with order fees and TaxRule.zero()

This commit is contained in:
Raphael Michel
2020-08-04 14:06:54 +02:00
parent 9bb5c57792
commit 35c8684cd4

View File

@@ -1869,6 +1869,9 @@ class OrderFee(models.Model):
self.tax_rate = Decimal('0.00')
def save(self, *args, **kwargs):
if self.tax_rule and not self.tax_rule.rate and not self.tax_rule.pk:
self.tax_rule = None
if self.tax_rate is None:
self._calculate_tax()
self.order.touch()