Fix OrderChangeManager.change_price() for items without tax rule

This commit is contained in:
Raphael Michel
2020-07-15 09:14:58 +02:00
parent c585946e72
commit d3282a1acb

View File

@@ -1263,7 +1263,7 @@ class OrderChangeManager:
self._operations.append(self.RegenerateSecretOperation(position))
def change_price(self, position: OrderPosition, price: Decimal):
tax_rule = self._current_tax_rules().get(position.pk, position.tax_rule)
tax_rule = self._current_tax_rules().get(position.pk, position.tax_rule) or TaxRule.zero()
price = tax_rule.tax(price, base_price_is='gross')
if position.issued_gift_cards.exists():