Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Revert "Store variants in OrderItems"
Marcin Gębala2958ba31e3a8
diff --git a/saleor/order/migrations/0002_auto_20150715_0813.py b/saleor/order/migrations/0002_auto_20150715_0813.pydeleted file mode 100644index e7238f294e..0000000000--- a/saleor/order/migrations/0002_auto_20150715_0813.py+++ /dev/null@@ -1,20 +0,0 @@-# -*- coding: utf-8 -*--from __future__ import unicode_literals--from django.db import models, migrations-import django.db.models.deletion---class Migration(migrations.Migration):-- dependencies = [- ('order', '0001_initial'),- ]-- operations = [- migrations.AlterField(- model_name='ordereditem',- name='product',- field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='product', blank=True, to='product.ProductVariant', null=True),- ),- ]diff --git a/saleor/order/models.py b/saleor/order/models.pyindex 9f9e9058bd..89973fb422 100644--- a/saleor/order/models.py+++ b/saleor/order/models.py@@ -21,7 +21,7 @@ from prices import Pricefrom satchless.item import ItemSet, ItemLinefrom ..core.utils import build_absolute_uri-from ..product.models import Product, ProductVariant+from ..product.models import Productfrom ..userprofile.models import Address, Userfrom ..delivery import get_delivery@@ -206,7 +206,7 @@ class DeliveryGroup(models.Model, ItemSet):product_variant = item_line.productprice = item_line.get_price_per_item()self.items.create(- product=product_variant,+ product=product_variant.product,quantity=item_line.get_quantity(),unit_price_net=price.net,product_name=smart_text(product_variant),@@ -267,7 +267,7 @@ class OrderedItem(models.Model, ItemLine):delivery_group = models.ForeignKey(DeliveryGroup, related_name='items', editable=False)product = models.ForeignKey(- ProductVariant, blank=True, null=True, related_name='+',+ Product, blank=True, null=True, related_name='+',on_delete=models.SET_NULL,verbose_name=pgettext_lazy('OrderedItem field', 'product'))product_name = models.CharField(