Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Rename product to variant in Cartline model
Krzysztof Wolskica4caecdf672
diff --git a/saleor/cart/migrations/0002_auto_20161014_1221.py b/saleor/cart/migrations/0002_auto_20161014_1221.pynew file mode 100644index 0000000000..edf752fee1--- /dev/null+++ b/saleor/cart/migrations/0002_auto_20161014_1221.py@@ -0,0 +1,25 @@+# -*- coding: utf-8 -*-+# Generated by Django 1.10.1 on 2016-10-14 17:21+from __future__ import unicode_literals++from django.db import migrations+++class Migration(migrations.Migration):++ dependencies = [+ ('product', '0012_auto_20160218_0812'),+ ('cart', '0001_initial'),+ ]++ operations = [+ migrations.RenameField(+ model_name='cartline',+ old_name='product',+ new_name='variant',+ ),+ migrations.AlterUniqueTogether(+ name='cartline',+ unique_together=set([('cart', 'variant', 'data')]),+ ),+ ]diff --git a/saleor/order/models.py b/saleor/order/models.pyindex dfa4a0d54a..8c21322ca6 100644--- a/saleor/order/models.py+++ b/saleor/order/models.py@@ -239,7 +239,7 @@ class DeliveryGroup(models.Model, ItemSet):def add_items_from_partition(self, partition, discounts=None):for item_line in partition:- product_variant = item_line.product+ product_variant = item_line.variantprice = item_line.get_price_per_item(discounts)quantity = item_line.get_quantity()stock = product_variant.select_stockrecord(quantity)