Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Change if conditions for TaxedMoney fields
Maciej Korycinski9d5f41e9d8af
diff --git a/saleor/core/taxes/interface.py b/saleor/core/taxes/interface.pyindex 01a03fb76b..f66da247c2 100644--- a/saleor/core/taxes/interface.py+++ b/saleor/core/taxes/interface.py@@ -26,7 +26,7 @@ def calculate_checkout_total(elif settings.AVATAX_USERNAME_OR_ACCOUNT and settings.AVATAX_PASSWORD_OR_LICENSE:total = avatax_interface.calculate_checkout_total(checkout, discounts)- if total:+ if total is not None:return quantize_price(total, total.currency)total = checkout.get_total(discounts)@@ -44,7 +44,7 @@ def calculate_checkout_subtotal(elif settings.AVATAX_USERNAME_OR_ACCOUNT and settings.AVATAX_PASSWORD_OR_LICENSE:subtotal = avatax_interface.calculate_checkout_subtotal(checkout, discounts)- if subtotal:+ if subtotal is not None:return quantize_price(subtotal, subtotal.currency)subtotal = checkout.get_subtotal(discounts)@@ -74,7 +74,7 @@ def calculate_order_shipping(order: "Order") -> TaxedMoney:elif settings.AVATAX_USERNAME_OR_ACCOUNT and settings.AVATAX_PASSWORD_OR_LICENSE:shipping_price = avatax_interface.calculate_order_shipping(order)- if shipping_price:+ if shipping_price is not None:return quantize_price(shipping_price, shipping_price.currency)shipping_price = order.shipping_method.pricereturn quantize_price(@@ -116,7 +116,7 @@ def calculate_checkout_line_total()elif settings.AVATAX_USERNAME_OR_ACCOUNT and settings.AVATAX_PASSWORD_OR_LICENSE:total = avatax_interface.calculate_checkout_line_total(checkout_line, discounts)- if total:+ if total is not None:return quantize_price(total, total.currency)total = checkout_line.get_total(discounts)return quantize_price(TaxedMoney(net=total, gross=total), total.currency)