From f2593d9b4bbe11591b49cc2bb0c06ef262891dde Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 12 Sep 2022 21:20:04 +0200 Subject: [PATCH] Fix crash if product with bundles has no tax rule --- src/pretix/base/models/items.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pretix/base/models/items.py b/src/pretix/base/models/items.py index c7b5e531fc..7e60a79954 100644 --- a/src/pretix/base/models/items.py +++ b/src/pretix/base/models/items.py @@ -600,10 +600,14 @@ class Item(LoggedModel): invoice_address=invoice_address, base_price_is='gross', currency=currency) - compare_price = self.tax_rule.tax(b.designated_price * b.count, - override_tax_rate=override_tax_rate, - invoice_address=invoice_address, - currency=currency) + if not self.tax_rule: + compare_price = TaxedPrice(gross=b.designated_price * b.count, net=b.designated_price * b.count, + tax=Decimal('0.00'), rate=Decimal('0.00'), name='') + else: + compare_price = self.tax_rule.tax(b.designated_price * b.count, + override_tax_rate=override_tax_rate, + invoice_address=invoice_address, + currency=currency) t.net += bprice.net - compare_price.net t.tax += bprice.tax - compare_price.tax t.name = "MIXED!"