Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix ProductType with no TaxRateType

fowczarekdbc98db3e6c0
diff --git a/saleor/dashboard/product/forms.py b/saleor/dashboard/product/forms.py
index 8616a7e526..1105441be5 100644
--- a/saleor/dashboard/product/forms.py
+++ b/saleor/dashboard/product/forms.py
@@ -58,7 +58,7 @@ class ProductTypeSelectorForm(forms.Form):
def get_tax_rate_type_choices():
- rate_types = get_tax_rate_types() + [DEFAULT_TAX_RATE_NAME, '']
+ rate_types = get_tax_rate_types() + [DEFAULT_TAX_RATE_NAME]
translations = dict(TaxRateType.CHOICES)
choices = [
(rate_name, translations.get(rate_name, '---------'))
diff --git a/saleor/product/models.py b/saleor/product/models.py
index 59b6d79fff..5391cbd34d 100644
--- a/saleor/product/models.py
+++ b/saleor/product/models.py
@@ -77,7 +77,7 @@ class ProductType(models.Model):
has_variants = models.BooleanField(default=True)
is_shipping_required = models.BooleanField(default=False)
tax_rate = models.CharField(
- max_length=128, default=DEFAULT_TAX_RATE_NAME, blank=True,
+ max_length=128, default=DEFAULT_TAX_RATE_NAME,
choices=TaxRateType.CHOICES)
weight = MeasurementField(
measurement=Weight, unit_choices=WeightUnits.CHOICES,