Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Rollback to pass is_charge_taxes_on_shipping directly item_tax
Gabriel L Martinez3afd3e5ea4dd
diff --git a/saleor/data_feeds/google_merchant.py b/saleor/data_feeds/google_merchant.pyindex b1d5ae7d79..21f7520652 100644--- a/saleor/data_feeds/google_merchant.py+++ b/saleor/data_feeds/google_merchant.py@@ -10,6 +10,7 @@ from django.utils import timezonefrom django.utils.encoding import smart_textfrom django_countries.fields import Country+from ..core.taxes import charge_taxes_on_shippingfrom ..discount import DiscountInfofrom ..discount.utils import fetch_discountsfrom ..plugins.manager import get_plugins_manager@@ -118,7 +119,9 @@ def item_brand(item: ProductVariant, attributes_dict, attribute_values_dict):def item_tax(- item: ProductVariant, discounts: Iterable[DiscountInfo], current_site: Site,+ item: ProductVariant,+ discounts: Iterable[DiscountInfo],+ is_charge_taxes_on_shipping: bool,):"""Return item tax.@@ -131,7 +134,6 @@ def item_tax(item.product.product_type, country)if tax_rate:- is_charge_taxes_on_shipping = current_site.settings.charge_taxes_on_shippingtax_ship = "yes" if is_charge_taxes_on_shipping else "no"return "%s::%s:%s" % (country.code, tax_rate, tax_ship)return None@@ -192,6 +194,7 @@ def item_attributes(discounts: Iterable[DiscountInfo],attributes_dict,attribute_values_dict,+ is_charge_taxes_on_shipping: bool,):product_data = {"id": item_id(item),@@ -214,7 +217,7 @@ def item_attributes(if sale_price != price:product_data["sale_price"] = sale_price- tax = item_tax(item, discounts, current_site)+ tax = item_tax(item, discounts, is_charge_taxes_on_shipping)if tax:product_data["tax"] = tax@@ -227,6 +230,7 @@ def item_attributes(def write_feed(file_obj):"""Write feed contents info provided file object."""+ is_charge_taxes_on_shipping = charge_taxes_on_shipping()writer = csv.DictWriter(file_obj, ATTRIBUTES, dialect=csv.excel_tab)writer.writeheader()categories = Category.objects.all()@@ -246,6 +250,7 @@ def write_feed(file_obj):discounts,attributes_dict,attribute_values_dict,+ is_charge_taxes_on_shipping,)writer.writerow(item_data)diff --git a/saleor/data_feeds/tests/test_data_feeds.py b/saleor/data_feeds/tests/test_data_feeds.pyindex 6053132d78..e303d0e2f5 100644--- a/saleor/data_feeds/tests/test_data_feeds.py+++ b/saleor/data_feeds/tests/test_data_feeds.py@@ -4,6 +4,7 @@ from unittest.mock import Mockfrom django.utils.encoding import smart_text+from ...core.taxes import charge_taxes_on_shippingfrom ...product.models import AttributeValue, Categoryfrom ..google_merchant import (get_feed_items,@@ -15,6 +16,7 @@ from ..google_merchant import (def test_saleor_feed_items(product, site_settings):+ is_charge_taxes_on_shipping = charge_taxes_on_shipping()valid_variant = product.variants.first()items = get_feed_items()assert len(items) == 1@@ -34,6 +36,7 @@ def test_saleor_feed_items(product, site_settings):discounts,attributes_dict,attribute_values_dict,+ is_charge_taxes_on_shipping,)assert attributes.get("mpn") == valid_variant.skuassert attributes.get("availability") == "in stock"