Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Drop Product.charge_taxes model field (#12709)
Marcin Gębalaeb2d368d7885
diff --git a/saleor/plugins/avatax/tests/test_avatax.py b/saleor/plugins/avatax/tests/test_avatax.pyindex 83a555b8d7..ef8c6ecf26 100644--- a/saleor/plugins/avatax/tests/test_avatax.py+++ b/saleor/plugins/avatax/tests/test_avatax.py@@ -1992,12 +1992,13 @@ def test_calculate_checkout_subtotal_for_product_without_tax(shipping_zone,address,plugin_configuration,+ tax_class_zero_rates,):plugin_configuration()variant = stock.product_variantproduct = variant.product- product.charge_taxes = False- product.save(update_fields=["charge_taxes"])+ product.tax_class = tax_class_zero_rates+ product.save(update_fields=["tax_class"])monkeypatch.setattr("saleor.plugins.avatax.plugin.get_cached_tax_codes_or_fetch",@@ -5191,8 +5192,7 @@ def test_generate_request_data_from_checkout_lines_adds_lines_with_taxes_disableline = checkout_with_item.lines.first()line.variant.product.tax_class = tax_class_zero_rates- line.variant.product.charge_taxes = False- line.variant.product.save(update_fields=["tax_class", "charge_taxes"])+ line.variant.product.save(update_fields=["tax_class"])checkout_with_item.shipping_method = Nonecheckout_with_item.save(update_fields=["shipping_method"])@@ -5373,8 +5373,7 @@ def test_get_order_lines_data_adds_lines_with_taxes_disabled_for_line(line = order_with_lines.lines.first()line.variant.product.tax_class = tax_class_zero_rates- line.variant.product.charge_taxes = False- line.variant.product.save(update_fields=["charge_taxes", "tax_class"])+ line.variant.product.save(update_fields=["tax_class"])# whenlines_data = get_order_lines_data(order_with_lines, avatax_config, discounted=False)diff --git a/saleor/product/migrations/0185_unmount_product_charge_taxes.py b/saleor/product/migrations/0185_unmount_product_charge_taxes.pynew file mode 100644index 0000000000..45671cb334--- /dev/null+++ b/saleor/product/migrations/0185_unmount_product_charge_taxes.py@@ -0,0 +1,25 @@+# Generated by Django 3.2.19 on 2023-06-05 10:34++from django.db import migrations, models+++class Migration(migrations.Migration):+ dependencies = [+ ("product", "0184_product_product_gin"),+ ]++ state_operations = [+ migrations.RemoveField(+ model_name="product",+ name="charge_taxes",+ ),+ ]++ operations = [+ migrations.AlterField(+ model_name="product",+ name="charge_taxes",+ field=models.BooleanField(default=True, null=True),+ ),+ migrations.SeparateDatabaseAndState(state_operations=state_operations),+ ]diff --git a/saleor/product/models.py b/saleor/product/models.pyindex 6cc95fb0b8..ca5129e9f2 100644--- a/saleor/product/models.py+++ b/saleor/product/models.py@@ -441,9 +441,6 @@ class Product(SeoModel, ModelWithMetadata, ModelWithExternalReference):on_delete=models.SET_NULL,)- # deprecated- charge_taxes = models.BooleanField(default=True)-objects = ProductManager()translated = TranslationProxy()