Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix incorrect argument for call of update_order_pirces (#7026)
Maciej Korycinskib6a8061b8e4d
diff --git a/saleor/graphql/order/mutations/orders.py b/saleor/graphql/order/mutations/orders.pyindex 05ed6273f9..2272f3ff13 100644--- a/saleor/graphql/order/mutations/orders.py+++ b/saleor/graphql/order/mutations/orders.py@@ -280,7 +280,11 @@ class OrderUpdateShipping(BaseMutation):"shipping_tax_rate",])- update_order_prices(order, info.context.plugins, info.context.site.settings)+ update_order_prices(+ order,+ info.context.plugins,+ info.context.site.settings.include_taxes_in_prices,+ )# Post-process the resultsorder_shipping_updated(order)return OrderUpdateShipping(order=order)diff --git a/saleor/order/tests/test_order.py b/saleor/order/tests/test_order.pyindex 92dc44ea0f..3773265b61 100644--- a/saleor/order/tests/test_order.py+++ b/saleor/order/tests/test_order.py@@ -490,7 +490,9 @@ def test_update_order_prices().priceshipping_price = TaxedMoney(net=shipping_price, gross=shipping_price)- update_order_prices(order_with_lines, manager, site_settings)+ update_order_prices(+ order_with_lines, manager, site_settings.include_taxes_in_prices+ )line_1.refresh_from_db()line_2.refresh_from_db()@@ -534,7 +536,9 @@ def test_update_order_prices_tax_included(order_with_lines, vatlayer, site_settichannel_id=order_with_lines.channel_id).price- update_order_prices(order_with_lines, manager, site_settings)+ update_order_prices(+ order_with_lines, manager, site_settings.include_taxes_in_prices+ )line_1.refresh_from_db()line_2.refresh_from_db()diff --git a/saleor/order/utils.py b/saleor/order/utils.pyindex 7e8abd1433..6918ffe558 100644--- a/saleor/order/utils.py+++ b/saleor/order/utils.py@@ -1,7 +1,7 @@import copyfrom decimal import Decimalfrom functools import partial, wraps-from typing import Iterable, List, Optional, Tuple, Union+from typing import TYPE_CHECKING, Iterable, List, Optional, Tuple, Unionfrom django.conf import settingsfrom django.db import transaction@@ -23,6 +23,9 @@ from ..warehouse.management import deallocate_stock, increase_stockfrom ..warehouse.models import Warehousefrom . import events+if TYPE_CHECKING:+ from ..plugins.manager import PluginsManager+def get_order_country(order: Order) -> str:"""Return country to which order will be shipped."""@@ -193,7 +196,7 @@ def update_taxes_for_order_line(def update_taxes_for_order_lines(- lines: List[OrderLine], order: "Order", manager, tax_included+ lines: Iterable[OrderLine], order: "Order", manager, tax_included):for line in lines:update_taxes_for_order_line(line, order, manager, tax_included=tax_included)@@ -209,7 +212,7 @@ def update_taxes_for_order_lines()-def update_order_prices(order, manager, tax_included):+def update_order_prices(order: Order, manager: "PluginsManager", tax_included: bool):"""Update prices in order with given discounts and proper taxes."""update_taxes_for_order_lines(order.lines.all(), order, manager, tax_included)