Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Merge branch 'master' into 2098/support_for_digital_product
Maciej Korycinskiecc8aeceae11
diff --cc saleor/product/migrations/0091_auto_20190402_0853.pyindex 843c5807bd,0000000000..2698b133cemode 100644,000000..100644--- a/saleor/product/migrations/0091_auto_20190402_0853.py+++ b/saleor/product/migrations/0091_auto_20190402_0853.py@@@ -1,44 -1,0 +1,44 @@@- # Generated by Django 2.1.7 on 2019-03-29 11:49++# Generated by Django 2.1.7 on 2019-04-02 13:53+- from django.db import migrations, models+import django.db.models.deletion++from django.db import migrations, models+++class Migration(migrations.Migration):++ dependencies = [+ ('order', '0069_auto_20190225_2305'),- ('product', '0089_auto_20190225_0252'),++ ('product', '0090_auto_20190328_0608'),+ ]++ operations = [+ migrations.CreateModel(+ name='DigitalContent',+ fields=[+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),+ ('use_default_settings', models.BooleanField(default=True)),+ ('automatic_fulfillment', models.BooleanField(default=False)),+ ('content_type', models.CharField(choices=[('file', 'digital_product')], default='file', max_length=128)),+ ('content_file', models.FileField(blank=True, upload_to='digital_contents')),+ ('max_downloads', models.IntegerField(blank=True, null=True)),+ ('url_valid_days', models.IntegerField(blank=True, null=True)),+ ('product_variant', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='digital_content', to='product.ProductVariant')),+ ],+ ),+ migrations.CreateModel(+ name='DigitalContentUrl',+ fields=[+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),+ ('token', models.UUIDField(editable=False, unique=True)),+ ('created', models.DateTimeField(auto_now_add=True)),+ ('download_num', models.IntegerField(default=0)),+ ('content', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='urls', to='product.DigitalContent')),+ ('line', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='digital_content_url', to='order.OrderLine')),+ ],+ ),+ migrations.AddField(+ model_name='producttype',+ name='is_digital',+ field=models.BooleanField(default=False),+ ),+ ]diff --cc saleor/product/models.pyindex 7c058c48bc,5bf30f8303..86f3844a78--- a/saleor/product/models.py+++ b/saleor/product/models.py@@@ -80,10 -77,7 +80,8 @@@ class ProductType(models.Model)name = models.CharField(max_length=128)has_variants = models.BooleanField(default=True)is_shipping_required = models.BooleanField(default=True)+ is_digital = models.BooleanField(default=False)- tax_rate = models.CharField(- max_length=128, default=DEFAULT_TAX_RATE_NAME,- choices=TaxRateType.CHOICES)+ tax_rate = models.CharField(max_length=128, choices=TaxRateType.CHOICES)weight = MeasurementField(measurement=Weight, unit_choices=WeightUnits.CHOICES,default=zero_weight)diff --cc tests/conftest.pyindex 493339f31a,07d546df76..8f07db5e7b--- a/tests/conftest.py+++ b/tests/conftest.py@@@ -20,7 -20,9 +20,8 @@@ from saleor.account.models import Addrefrom saleor.checkout import utilsfrom saleor.checkout.models import Cartfrom saleor.checkout.utils import add_variant_to_cart+ from saleor.core.utils.taxes import DEFAULT_TAX_RATE_NAMEfrom saleor.dashboard.menu.utils import update_menu-from saleor.dashboard.order.utils import fulfill_order_linefrom saleor.discount import VoucherTypefrom saleor.discount.models import Sale, Voucher, VoucherTranslationfrom saleor.menu.models import Menu, MenuItem