From 9ddedc6915f69aa0988ab8d6dce0b4ec64687b9c Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 19 May 2019 00:11:41 +1000 Subject: [PATCH] Restart migrations - Easier to delete all the migrations and start again :'( --- InvenTree/build/migrations/0001_initial.py | 36 +++++--- .../migrations/0002_auto_20190412_2030.py | 25 ------ .../migrations/0003_builditemallocation.py | 25 ------ InvenTree/build/migrations/0004_build_url.py | 18 ---- .../migrations/0005_auto_20190429_2229.py | 18 ---- .../migrations/0006_auto_20190429_2233.py | 18 ---- .../migrations/0007_auto_20190429_2255.py | 18 ---- .../migrations/0008_auto_20190501_2344.py | 25 ------ .../migrations/0009_build_completed_by.py | 21 ----- .../migrations/0010_auto_20190505_2233.py | 19 ---- .../migrations/0011_auto_20190508_0748.py | 19 ---- .../migrations/0012_auto_20190508_2332.py | 30 ------- .../build/migrations/0013_build_take_from.py | 20 ----- .../migrations/0014_auto_20190518_1543.py | 19 ---- InvenTree/company/migrations/0001_initial.py | 61 +++++++++++-- .../migrations/0002_auto_20180422_1201.py | 25 ------ .../migrations/0002_auto_20190519_0004.py} | 35 ++++---- .../migrations/0003_auto_20180423_1117.py | 25 ------ .../company/migrations/0004_company_url.py | 20 ----- InvenTree/company/migrations/0005_contact.py | 27 ------ .../migrations/0006_auto_20190508_2332.py | 43 ---------- .../0007_supplierpart_supplierpricebreak.py | 52 ----------- .../migrations/0008_auto_20190518_2120.py | 19 ---- InvenTree/part/migrations/0001_initial.py | 86 +++++-------------- .../migrations/0002_auto_20190519_0004.py | 77 +++++++++++++++++ .../migrations/0002_part_default_location.py | 22 ----- .../migrations/0003_auto_20190412_2030.py | 19 ---- .../part/migrations/0004_bomitem_note.py | 18 ---- .../part/migrations/0005_part_consumable.py | 18 ---- .../migrations/0006_auto_20190416_2354.py | 30 ------- .../migrations/0007_auto_20190417_0007.py | 54 ------------ .../migrations/0008_auto_20190417_0013.py | 19 ---- .../migrations/0009_auto_20190417_0019.py | 19 ---- .../migrations/0010_auto_20190417_0045.py | 24 ------ .../migrations/0011_auto_20190428_0841.py | 19 ---- InvenTree/part/migrations/0012_part_active.py | 23 ----- .../migrations/0013_auto_20190429_2229.py | 18 ---- .../migrations/0014_auto_20190502_2039.py | 18 ---- .../0015_partcategory_default_location.py | 20 ----- InvenTree/part/migrations/0016_partstar.py | 24 ------ .../migrations/0017_auto_20190505_0848.py | 19 ---- .../migrations/0018_auto_20190505_2231.py | 24 ------ .../migrations/0020_auto_20190510_2022.py | 27 ------ .../migrations/0021_auto_20190510_2220.py | 19 ---- .../migrations/0022_auto_20190512_1246.py | 31 ------- .../part/migrations/0023_part_keywords.py | 18 ---- .../0024_partcategory_default_keywords.py | 18 ---- .../migrations/0025_auto_20190515_0012.py | 46 ---------- .../0026_remove_supplierpart_single_price.py | 17 ---- .../migrations/0027_auto_20190518_1620.py | 18 ---- .../migrations/0028_auto_20190518_1627.py | 19 ---- .../migrations/0029_auto_20190518_1632.py | 19 ---- .../migrations/0030_auto_20190518_1641.py | 19 ---- .../migrations/0031_auto_20190518_1650.py | 19 ---- .../migrations/0032_auto_20190518_1759.py | 34 -------- InvenTree/stock/migrations/0001_initial.py | 57 ++++++------ .../migrations/0002_auto_20180430_1218.py | 21 ----- .../migrations/0003_auto_20180510_1042.py | 20 ----- .../migrations/0004_auto_20190412_2030.py | 19 ---- .../0005_stockitemtracking_quantity.py | 19 ---- .../stock/migrations/0006_stockitem_uuid.py | 19 ---- .../migrations/0007_auto_20190417_1812.py | 18 ---- .../migrations/0008_auto_20190417_1819.py | 20 ----- .../migrations/0009_auto_20190428_0841.py | 19 ---- .../migrations/0010_auto_20190501_2344.py | 18 ---- .../migrations/0011_auto_20190502_0041.py | 19 ---- .../migrations/0012_auto_20190502_0058.py | 19 ---- .../migrations/0013_remove_stockitem_uuid.py | 17 ---- .../migrations/0014_auto_20190508_2332.py | 19 ---- .../0015_stockitem_delete_on_deplete.py | 18 ---- .../migrations/0016_auto_20190512_2119.py | 18 ---- .../migrations/0017_auto_20190518_1759.py | 19 ---- InvenTree/stock/models.py | 1 - 73 files changed, 224 insertions(+), 1609 deletions(-) delete mode 100644 InvenTree/build/migrations/0002_auto_20190412_2030.py delete mode 100644 InvenTree/build/migrations/0003_builditemallocation.py delete mode 100644 InvenTree/build/migrations/0004_build_url.py delete mode 100644 InvenTree/build/migrations/0005_auto_20190429_2229.py delete mode 100644 InvenTree/build/migrations/0006_auto_20190429_2233.py delete mode 100644 InvenTree/build/migrations/0007_auto_20190429_2255.py delete mode 100644 InvenTree/build/migrations/0008_auto_20190501_2344.py delete mode 100644 InvenTree/build/migrations/0009_build_completed_by.py delete mode 100644 InvenTree/build/migrations/0010_auto_20190505_2233.py delete mode 100644 InvenTree/build/migrations/0011_auto_20190508_0748.py delete mode 100644 InvenTree/build/migrations/0012_auto_20190508_2332.py delete mode 100644 InvenTree/build/migrations/0013_build_take_from.py delete mode 100644 InvenTree/build/migrations/0014_auto_20190518_1543.py delete mode 100644 InvenTree/company/migrations/0002_auto_20180422_1201.py rename InvenTree/{part/migrations/0019_auto_20190508_2332.py => company/migrations/0002_auto_20190519_0004.py} (51%) delete mode 100644 InvenTree/company/migrations/0003_auto_20180423_1117.py delete mode 100644 InvenTree/company/migrations/0004_company_url.py delete mode 100644 InvenTree/company/migrations/0005_contact.py delete mode 100644 InvenTree/company/migrations/0006_auto_20190508_2332.py delete mode 100644 InvenTree/company/migrations/0007_supplierpart_supplierpricebreak.py delete mode 100644 InvenTree/company/migrations/0008_auto_20190518_2120.py create mode 100644 InvenTree/part/migrations/0002_auto_20190519_0004.py delete mode 100644 InvenTree/part/migrations/0002_part_default_location.py delete mode 100644 InvenTree/part/migrations/0003_auto_20190412_2030.py delete mode 100644 InvenTree/part/migrations/0004_bomitem_note.py delete mode 100644 InvenTree/part/migrations/0005_part_consumable.py delete mode 100644 InvenTree/part/migrations/0006_auto_20190416_2354.py delete mode 100644 InvenTree/part/migrations/0007_auto_20190417_0007.py delete mode 100644 InvenTree/part/migrations/0008_auto_20190417_0013.py delete mode 100644 InvenTree/part/migrations/0009_auto_20190417_0019.py delete mode 100644 InvenTree/part/migrations/0010_auto_20190417_0045.py delete mode 100644 InvenTree/part/migrations/0011_auto_20190428_0841.py delete mode 100644 InvenTree/part/migrations/0012_part_active.py delete mode 100644 InvenTree/part/migrations/0013_auto_20190429_2229.py delete mode 100644 InvenTree/part/migrations/0014_auto_20190502_2039.py delete mode 100644 InvenTree/part/migrations/0015_partcategory_default_location.py delete mode 100644 InvenTree/part/migrations/0016_partstar.py delete mode 100644 InvenTree/part/migrations/0017_auto_20190505_0848.py delete mode 100644 InvenTree/part/migrations/0018_auto_20190505_2231.py delete mode 100644 InvenTree/part/migrations/0020_auto_20190510_2022.py delete mode 100644 InvenTree/part/migrations/0021_auto_20190510_2220.py delete mode 100644 InvenTree/part/migrations/0022_auto_20190512_1246.py delete mode 100644 InvenTree/part/migrations/0023_part_keywords.py delete mode 100644 InvenTree/part/migrations/0024_partcategory_default_keywords.py delete mode 100644 InvenTree/part/migrations/0025_auto_20190515_0012.py delete mode 100644 InvenTree/part/migrations/0026_remove_supplierpart_single_price.py delete mode 100644 InvenTree/part/migrations/0027_auto_20190518_1620.py delete mode 100644 InvenTree/part/migrations/0028_auto_20190518_1627.py delete mode 100644 InvenTree/part/migrations/0029_auto_20190518_1632.py delete mode 100644 InvenTree/part/migrations/0030_auto_20190518_1641.py delete mode 100644 InvenTree/part/migrations/0031_auto_20190518_1650.py delete mode 100644 InvenTree/part/migrations/0032_auto_20190518_1759.py delete mode 100644 InvenTree/stock/migrations/0002_auto_20180430_1218.py delete mode 100644 InvenTree/stock/migrations/0003_auto_20180510_1042.py delete mode 100644 InvenTree/stock/migrations/0004_auto_20190412_2030.py delete mode 100644 InvenTree/stock/migrations/0005_stockitemtracking_quantity.py delete mode 100644 InvenTree/stock/migrations/0006_stockitem_uuid.py delete mode 100644 InvenTree/stock/migrations/0007_auto_20190417_1812.py delete mode 100644 InvenTree/stock/migrations/0008_auto_20190417_1819.py delete mode 100644 InvenTree/stock/migrations/0009_auto_20190428_0841.py delete mode 100644 InvenTree/stock/migrations/0010_auto_20190501_2344.py delete mode 100644 InvenTree/stock/migrations/0011_auto_20190502_0041.py delete mode 100644 InvenTree/stock/migrations/0012_auto_20190502_0058.py delete mode 100644 InvenTree/stock/migrations/0013_remove_stockitem_uuid.py delete mode 100644 InvenTree/stock/migrations/0014_auto_20190508_2332.py delete mode 100644 InvenTree/stock/migrations/0015_stockitem_delete_on_deplete.py delete mode 100644 InvenTree/stock/migrations/0016_auto_20190512_2119.py delete mode 100644 InvenTree/stock/migrations/0017_auto_20190518_1759.py diff --git a/InvenTree/build/migrations/0001_initial.py b/InvenTree/build/migrations/0001_initial.py index 26e835b978..aa7356389a 100644 --- a/InvenTree/build/migrations/0001_initial.py +++ b/InvenTree/build/migrations/0001_initial.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.12 on 2018-04-22 11:53 -from __future__ import unicode_literals +# Generated by Django 2.2 on 2019-05-18 14:04 +from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion @@ -12,7 +11,9 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('part', '0001_initial'), + ('part', '0002_auto_20190519_0004'), + ('stock', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ @@ -20,14 +21,29 @@ class Migration(migrations.Migration): name='Build', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('batch', models.CharField(blank=True, help_text='Batch code for this build output', max_length=100, null=True)), - ('status', models.PositiveIntegerField(choices=[(40, 'Complete'), (10, 'Pending'), (20, 'Holding'), (30, 'Cancelled')], default=10, validators=[django.core.validators.MinValueValidator(0)])), - ('creation_date', models.DateField(auto_now=True)), - ('completion_date', models.DateField(blank=True, null=True)), ('title', models.CharField(help_text='Brief description of the build', max_length=100)), ('quantity', models.PositiveIntegerField(default=1, help_text='Number of parts to build', validators=[django.core.validators.MinValueValidator(1)])), - ('notes', models.TextField(blank=True)), - ('part', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='builds', to='part.Part')), + ('status', models.PositiveIntegerField(choices=[(10, 'Pending'), (20, 'Allocated'), (30, 'Cancelled'), (40, 'Complete')], default=10, help_text='Build status', validators=[django.core.validators.MinValueValidator(0)])), + ('batch', models.CharField(blank=True, help_text='Batch code for this build output', max_length=100, null=True)), + ('creation_date', models.DateField(auto_now=True)), + ('completion_date', models.DateField(blank=True, null=True)), + ('URL', models.URLField(blank=True, help_text='Link to external URL')), + ('notes', models.TextField(blank=True, help_text='Extra build notes')), + ('completed_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='builds_completed', to=settings.AUTH_USER_MODEL)), + ('part', models.ForeignKey(help_text='Select part to build', limit_choices_to={'active': True, 'buildable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='builds', to='part.Part')), + ('take_from', models.ForeignKey(blank=True, help_text='Select location to take stock from for this build (leave blank to take from any stock location)', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sourcing_builds', to='stock.StockLocation')), ], ), + migrations.CreateModel( + name='BuildItem', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('quantity', models.PositiveIntegerField(default=1, help_text='Stock quantity to allocate to build', validators=[django.core.validators.MinValueValidator(1)])), + ('build', models.ForeignKey(help_text='Build to allocate parts', on_delete=django.db.models.deletion.CASCADE, related_name='allocated_stock', to='build.Build')), + ('stock_item', models.ForeignKey(help_text='Stock Item to allocate to build', on_delete=django.db.models.deletion.CASCADE, related_name='allocations', to='stock.StockItem')), + ], + options={ + 'unique_together': {('build', 'stock_item')}, + }, + ), ] diff --git a/InvenTree/build/migrations/0002_auto_20190412_2030.py b/InvenTree/build/migrations/0002_auto_20190412_2030.py deleted file mode 100644 index eca2bf5adb..0000000000 --- a/InvenTree/build/migrations/0002_auto_20190412_2030.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 2.2 on 2019-04-12 10:30 - -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('build', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='build', - name='part', - field=models.ForeignKey(limit_choices_to={'buildable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='builds', to='part.Part'), - ), - migrations.AlterField( - model_name='build', - name='status', - field=models.PositiveIntegerField(choices=[(10, 'Pending'), (20, 'Holding'), (30, 'Cancelled'), (40, 'Complete')], default=10, validators=[django.core.validators.MinValueValidator(0)]), - ), - ] diff --git a/InvenTree/build/migrations/0003_builditemallocation.py b/InvenTree/build/migrations/0003_builditemallocation.py deleted file mode 100644 index add13c7ac1..0000000000 --- a/InvenTree/build/migrations/0003_builditemallocation.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 2.2 on 2019-04-29 12:14 - -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0009_auto_20190428_0841'), - ('build', '0002_auto_20190412_2030'), - ] - - operations = [ - migrations.CreateModel( - name='BuildItemAllocation', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('quantity', models.PositiveIntegerField(default=1, help_text='Stock quantity to allocate to build', validators=[django.core.validators.MinValueValidator(1)])), - ('build', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='allocated_stock', to='build.Build')), - ('stock', models.ForeignKey(help_text='Stock Item to allocate to build', on_delete=django.db.models.deletion.CASCADE, related_name='allocations', to='stock.StockItem')), - ], - ), - ] diff --git a/InvenTree/build/migrations/0004_build_url.py b/InvenTree/build/migrations/0004_build_url.py deleted file mode 100644 index 187ac938d1..0000000000 --- a/InvenTree/build/migrations/0004_build_url.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-04-29 12:18 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('build', '0003_builditemallocation'), - ] - - operations = [ - migrations.AddField( - model_name='build', - name='URL', - field=models.URLField(blank=True, help_text='Link to external URL'), - ), - ] diff --git a/InvenTree/build/migrations/0005_auto_20190429_2229.py b/InvenTree/build/migrations/0005_auto_20190429_2229.py deleted file mode 100644 index 73ebca7e1b..0000000000 --- a/InvenTree/build/migrations/0005_auto_20190429_2229.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-04-29 12:29 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0009_auto_20190428_0841'), - ('build', '0004_build_url'), - ] - - operations = [ - migrations.RenameModel( - old_name='BuildItemAllocation', - new_name='BuildItem', - ), - ] diff --git a/InvenTree/build/migrations/0006_auto_20190429_2233.py b/InvenTree/build/migrations/0006_auto_20190429_2233.py deleted file mode 100644 index 5d03e13b75..0000000000 --- a/InvenTree/build/migrations/0006_auto_20190429_2233.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-04-29 12:33 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('build', '0005_auto_20190429_2229'), - ] - - operations = [ - migrations.RenameField( - model_name='builditem', - old_name='stock', - new_name='stock_item', - ), - ] diff --git a/InvenTree/build/migrations/0007_auto_20190429_2255.py b/InvenTree/build/migrations/0007_auto_20190429_2255.py deleted file mode 100644 index 8a01606b84..0000000000 --- a/InvenTree/build/migrations/0007_auto_20190429_2255.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-04-29 12:55 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0009_auto_20190428_0841'), - ('build', '0006_auto_20190429_2233'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='builditem', - unique_together={('build', 'stock_item')}, - ), - ] diff --git a/InvenTree/build/migrations/0008_auto_20190501_2344.py b/InvenTree/build/migrations/0008_auto_20190501_2344.py deleted file mode 100644 index febdd2d1b1..0000000000 --- a/InvenTree/build/migrations/0008_auto_20190501_2344.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 2.2 on 2019-05-01 13:44 - -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('build', '0007_auto_20190429_2255'), - ] - - operations = [ - migrations.AlterField( - model_name='build', - name='status', - field=models.PositiveIntegerField(choices=[(10, 'Pending'), (30, 'Cancelled'), (40, 'Complete')], default=10, validators=[django.core.validators.MinValueValidator(0)]), - ), - migrations.AlterField( - model_name='builditem', - name='build', - field=models.ForeignKey(help_text='Build to allocate parts', on_delete=django.db.models.deletion.CASCADE, related_name='allocated_stock', to='build.Build'), - ), - ] diff --git a/InvenTree/build/migrations/0009_build_completed_by.py b/InvenTree/build/migrations/0009_build_completed_by.py deleted file mode 100644 index dc6c05a3f7..0000000000 --- a/InvenTree/build/migrations/0009_build_completed_by.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 2.2 on 2019-05-02 21:26 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('build', '0008_auto_20190501_2344'), - ] - - operations = [ - migrations.AddField( - model_name='build', - name='completed_by', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='builds_completed', to=settings.AUTH_USER_MODEL), - ), - ] diff --git a/InvenTree/build/migrations/0010_auto_20190505_2233.py b/InvenTree/build/migrations/0010_auto_20190505_2233.py deleted file mode 100644 index 5be6c393c9..0000000000 --- a/InvenTree/build/migrations/0010_auto_20190505_2233.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-05 12:33 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('build', '0009_build_completed_by'), - ] - - operations = [ - migrations.AlterField( - model_name='build', - name='part', - field=models.ForeignKey(limit_choices_to={'active': True, 'buildable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='builds', to='part.Part'), - ), - ] diff --git a/InvenTree/build/migrations/0011_auto_20190508_0748.py b/InvenTree/build/migrations/0011_auto_20190508_0748.py deleted file mode 100644 index e4c0ec5fa7..0000000000 --- a/InvenTree/build/migrations/0011_auto_20190508_0748.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-07 21:48 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('build', '0010_auto_20190505_2233'), - ] - - operations = [ - migrations.AlterField( - model_name='build', - name='status', - field=models.PositiveIntegerField(choices=[(10, 'Pending'), (20, 'Allocated'), (30, 'Cancelled'), (40, 'Complete')], default=10, validators=[django.core.validators.MinValueValidator(0)]), - ), - ] diff --git a/InvenTree/build/migrations/0012_auto_20190508_2332.py b/InvenTree/build/migrations/0012_auto_20190508_2332.py deleted file mode 100644 index 099fce3fe9..0000000000 --- a/InvenTree/build/migrations/0012_auto_20190508_2332.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 2.2 on 2019-05-08 13:32 - -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('build', '0011_auto_20190508_0748'), - ] - - operations = [ - migrations.AlterField( - model_name='build', - name='notes', - field=models.TextField(blank=True, help_text='Extra build notes'), - ), - migrations.AlterField( - model_name='build', - name='part', - field=models.ForeignKey(help_text='Select part to build', limit_choices_to={'active': True, 'buildable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='builds', to='part.Part'), - ), - migrations.AlterField( - model_name='build', - name='status', - field=models.PositiveIntegerField(choices=[(10, 'Pending'), (20, 'Allocated'), (30, 'Cancelled'), (40, 'Complete')], default=10, help_text='Build status', validators=[django.core.validators.MinValueValidator(0)]), - ), - ] diff --git a/InvenTree/build/migrations/0013_build_take_from.py b/InvenTree/build/migrations/0013_build_take_from.py deleted file mode 100644 index 9945da2be1..0000000000 --- a/InvenTree/build/migrations/0013_build_take_from.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 2.2 on 2019-05-10 08:50 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0015_stockitem_delete_on_deplete'), - ('build', '0012_auto_20190508_2332'), - ] - - operations = [ - migrations.AddField( - model_name='build', - name='take_from', - field=models.ForeignKey(blank=True, help_text='Select location to take stock from for this build (leave blank to take from any stock location', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sourcing_builds', to='stock.StockLocation'), - ), - ] diff --git a/InvenTree/build/migrations/0014_auto_20190518_1543.py b/InvenTree/build/migrations/0014_auto_20190518_1543.py deleted file mode 100644 index 9fbd095445..0000000000 --- a/InvenTree/build/migrations/0014_auto_20190518_1543.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-18 05:43 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('build', '0013_build_take_from'), - ] - - operations = [ - migrations.AlterField( - model_name='build', - name='take_from', - field=models.ForeignKey(blank=True, help_text='Select location to take stock from for this build (leave blank to take from any stock location)', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sourcing_builds', to='stock.StockLocation'), - ), - ] diff --git a/InvenTree/company/migrations/0001_initial.py b/InvenTree/company/migrations/0001_initial.py index 791011304c..b4da1df89e 100644 --- a/InvenTree/company/migrations/0001_initial.py +++ b/InvenTree/company/migrations/0001_initial.py @@ -1,9 +1,9 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.12 on 2018-04-22 11:53 -from __future__ import unicode_literals +# Generated by Django 2.2 on 2019-05-18 14:04 import company.models +import django.core.validators from django.db import migrations, models +import django.db.models.deletion class Migration(migrations.Migration): @@ -18,15 +18,60 @@ class Migration(migrations.Migration): name='Company', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(help_text='Company naem', max_length=100, unique=True)), - ('description', models.CharField(max_length=500)), + ('name', models.CharField(help_text='Company name', max_length=100, unique=True)), + ('description', models.CharField(help_text='Description of the company', max_length=500)), ('website', models.URLField(blank=True, help_text='Company website URL')), ('address', models.CharField(blank=True, help_text='Company address', max_length=200)), - ('phone', models.CharField(blank=True, max_length=50)), - ('email', models.EmailField(blank=True, max_length=254)), - ('contact', models.CharField(blank=True, max_length=100)), + ('phone', models.CharField(blank=True, help_text='Contact phone number', max_length=50)), + ('email', models.EmailField(blank=True, help_text='Contact email address', max_length=254)), + ('contact', models.CharField(blank=True, help_text='Point of contact', max_length=100)), + ('URL', models.URLField(blank=True, help_text='Link to external company information')), ('image', models.ImageField(blank=True, max_length=255, null=True, upload_to=company.models.rename_company_image)), ('notes', models.TextField(blank=True)), + ('is_customer', models.BooleanField(default=False, help_text='Do you sell items to this company?')), + ('is_supplier', models.BooleanField(default=True, help_text='Do you purchase items from this company?')), ], ), + migrations.CreateModel( + name='Contact', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=100)), + ('phone', models.CharField(blank=True, max_length=100)), + ('email', models.EmailField(blank=True, max_length=254)), + ('role', models.CharField(blank=True, max_length=100)), + ], + ), + migrations.CreateModel( + name='SupplierPart', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('SKU', models.CharField(help_text='Supplier stock keeping unit', max_length=100)), + ('manufacturer', models.CharField(blank=True, help_text='Manufacturer', max_length=100)), + ('MPN', models.CharField(blank=True, help_text='Manufacturer part number', max_length=100)), + ('URL', models.URLField(blank=True, help_text='URL for external supplier part link')), + ('description', models.CharField(blank=True, help_text='Supplier part description', max_length=250)), + ('note', models.CharField(blank=True, help_text='Notes', max_length=100)), + ('base_cost', models.DecimalField(decimal_places=3, default=0, help_text='Minimum charge (e.g. stocking fee)', max_digits=10, validators=[django.core.validators.MinValueValidator(0)])), + ('packaging', models.CharField(blank=True, help_text='Part packaging', max_length=50)), + ('multiple', models.PositiveIntegerField(default=1, help_text='Order multiple', validators=[django.core.validators.MinValueValidator(1)])), + ('minimum', models.PositiveIntegerField(default=1, help_text='Minimum order quantity (MOQ)', validators=[django.core.validators.MinValueValidator(1)])), + ('lead_time', models.DurationField(blank=True, null=True)), + ], + options={ + 'db_table': 'part_supplierpart', + }, + ), + migrations.CreateModel( + name='SupplierPriceBreak', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('quantity', models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1)])), + ('cost', models.DecimalField(decimal_places=5, max_digits=10, validators=[django.core.validators.MinValueValidator(0)])), + ('part', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pricebreaks', to='company.SupplierPart')), + ], + options={ + 'db_table': 'part_supplierpricebreak', + }, + ), ] diff --git a/InvenTree/company/migrations/0002_auto_20180422_1201.py b/InvenTree/company/migrations/0002_auto_20180422_1201.py deleted file mode 100644 index 38578a58fe..0000000000 --- a/InvenTree/company/migrations/0002_auto_20180422_1201.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.12 on 2018-04-22 12:01 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('company', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='company', - name='is_customer', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='company', - name='is_supplier', - field=models.BooleanField(default=False), - ), - ] diff --git a/InvenTree/part/migrations/0019_auto_20190508_2332.py b/InvenTree/company/migrations/0002_auto_20190519_0004.py similarity index 51% rename from InvenTree/part/migrations/0019_auto_20190508_2332.py rename to InvenTree/company/migrations/0002_auto_20190519_0004.py index b61bbee82b..c34c315d48 100644 --- a/InvenTree/part/migrations/0019_auto_20190508_2332.py +++ b/InvenTree/company/migrations/0002_auto_20190519_0004.py @@ -1,35 +1,40 @@ -# Generated by Django 2.2 on 2019-05-08 13:32 +# Generated by Django 2.2 on 2019-05-18 14:04 from django.db import migrations, models import django.db.models.deletion -import part.models class Migration(migrations.Migration): + initial = True + dependencies = [ - ('part', '0018_auto_20190505_2231'), + ('company', '0001_initial'), + ('part', '0001_initial'), ] operations = [ - migrations.AlterField( - model_name='part', - name='units', - field=models.CharField(blank=True, default='pcs', help_text='Stock keeping units for this part', max_length=20), - ), - migrations.AlterField( - model_name='partattachment', - name='attachment', - field=models.FileField(blank=True, help_text='Select file to attach', null=True, upload_to=part.models.attach_file), - ), - migrations.AlterField( + migrations.AddField( model_name='supplierpart', name='part', field=models.ForeignKey(help_text='Select part', limit_choices_to={'purchaseable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='supplier_parts', to='part.Part'), ), - migrations.AlterField( + migrations.AddField( model_name='supplierpart', name='supplier', field=models.ForeignKey(help_text='Select supplier', limit_choices_to={'is_supplier': True}, on_delete=django.db.models.deletion.CASCADE, related_name='parts', to='company.Company'), ), + migrations.AddField( + model_name='contact', + name='company', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='contacts', to='company.Company'), + ), + migrations.AlterUniqueTogether( + name='supplierpricebreak', + unique_together={('part', 'quantity')}, + ), + migrations.AlterUniqueTogether( + name='supplierpart', + unique_together={('part', 'supplier', 'SKU')}, + ), ] diff --git a/InvenTree/company/migrations/0003_auto_20180423_1117.py b/InvenTree/company/migrations/0003_auto_20180423_1117.py deleted file mode 100644 index 638e3a1ab7..0000000000 --- a/InvenTree/company/migrations/0003_auto_20180423_1117.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.12 on 2018-04-23 11:17 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('company', '0002_auto_20180422_1201'), - ] - - operations = [ - migrations.AlterField( - model_name='company', - name='is_supplier', - field=models.BooleanField(default=True), - ), - migrations.AlterField( - model_name='company', - name='name', - field=models.CharField(help_text='Company name', max_length=100, unique=True), - ), - ] diff --git a/InvenTree/company/migrations/0004_company_url.py b/InvenTree/company/migrations/0004_company_url.py deleted file mode 100644 index e478757394..0000000000 --- a/InvenTree/company/migrations/0004_company_url.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.12 on 2018-04-24 08:01 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('company', '0003_auto_20180423_1117'), - ] - - operations = [ - migrations.AddField( - model_name='company', - name='URL', - field=models.URLField(blank=True, help_text='Link to external company information'), - ), - ] diff --git a/InvenTree/company/migrations/0005_contact.py b/InvenTree/company/migrations/0005_contact.py deleted file mode 100644 index 8a668a0590..0000000000 --- a/InvenTree/company/migrations/0005_contact.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.12 on 2018-04-30 07:19 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('company', '0004_company_url'), - ] - - operations = [ - migrations.CreateModel( - name='Contact', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ('phone', models.CharField(blank=True, max_length=100)), - ('email', models.EmailField(blank=True, max_length=254)), - ('role', models.CharField(blank=True, max_length=100)), - ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='contacts', to='company.Company')), - ], - ), - ] diff --git a/InvenTree/company/migrations/0006_auto_20190508_2332.py b/InvenTree/company/migrations/0006_auto_20190508_2332.py deleted file mode 100644 index 232ccdd4f1..0000000000 --- a/InvenTree/company/migrations/0006_auto_20190508_2332.py +++ /dev/null @@ -1,43 +0,0 @@ -# Generated by Django 2.2 on 2019-05-08 13:32 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('company', '0005_contact'), - ] - - operations = [ - migrations.AlterField( - model_name='company', - name='contact', - field=models.CharField(blank=True, help_text='Point of contact', max_length=100), - ), - migrations.AlterField( - model_name='company', - name='description', - field=models.CharField(help_text='Description of the company', max_length=500), - ), - migrations.AlterField( - model_name='company', - name='email', - field=models.EmailField(blank=True, help_text='Contact email address', max_length=254), - ), - migrations.AlterField( - model_name='company', - name='is_customer', - field=models.BooleanField(default=False, help_text='Do you sell items to this company?'), - ), - migrations.AlterField( - model_name='company', - name='is_supplier', - field=models.BooleanField(default=True, help_text='Do you purchase items from this company?'), - ), - migrations.AlterField( - model_name='company', - name='phone', - field=models.CharField(blank=True, help_text='Contact phone number', max_length=50), - ), - ] diff --git a/InvenTree/company/migrations/0007_supplierpart_supplierpricebreak.py b/InvenTree/company/migrations/0007_supplierpart_supplierpricebreak.py deleted file mode 100644 index f3cc3ea6de..0000000000 --- a/InvenTree/company/migrations/0007_supplierpart_supplierpricebreak.py +++ /dev/null @@ -1,52 +0,0 @@ -# Generated by Django 2.2 on 2019-05-18 07:59 - -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0032_auto_20190518_1759'), - ('company', '0006_auto_20190508_2332'), - ] - - operations = [ - migrations.CreateModel( - name='SupplierPart', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('SKU', models.CharField(help_text='Supplier stock keeping unit', max_length=100)), - ('manufacturer', models.CharField(blank=True, help_text='Manufacturer', max_length=100)), - ('MPN', models.CharField(blank=True, help_text='Manufacturer part number', max_length=100)), - ('URL', models.URLField(blank=True, help_text='URL for external supplier part link')), - ('description', models.CharField(blank=True, help_text='Supplier part description', max_length=250)), - ('note', models.CharField(blank=True, help_text='Notes', max_length=100)), - ('base_cost', models.DecimalField(decimal_places=3, default=0, help_text='Minimum charge (e.g. stocking fee)', max_digits=10, validators=[django.core.validators.MinValueValidator(0)])), - ('packaging', models.CharField(blank=True, help_text='Part packaging', max_length=50)), - ('multiple', models.PositiveIntegerField(default=1, help_text='Order multiple', validators=[django.core.validators.MinValueValidator(1)])), - ('minimum', models.PositiveIntegerField(default=1, help_text='Minimum order quantity (MOQ)', validators=[django.core.validators.MinValueValidator(1)])), - ('lead_time', models.DurationField(blank=True, null=True)), - ('part', models.ForeignKey(help_text='Select part', limit_choices_to={'purchaseable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='supplier_parts', to='part.Part')), - ('supplier', models.ForeignKey(help_text='Select supplier', limit_choices_to={'is_supplier': True}, on_delete=django.db.models.deletion.CASCADE, related_name='parts', to='company.Company')), - ], - options={ - 'db_table': 'part_supplierpart', - 'unique_together': {('part', 'supplier', 'SKU')}, - }, - ), - migrations.CreateModel( - name='SupplierPriceBreak', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('quantity', models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1)])), - ('cost', models.DecimalField(decimal_places=3, max_digits=10, validators=[django.core.validators.MinValueValidator(0)])), - ('part', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pricebreaks', to='company.SupplierPart')), - ], - options={ - 'db_table': 'part_supplierpricebreak', - 'unique_together': {('part', 'quantity')}, - }, - ), - ] diff --git a/InvenTree/company/migrations/0008_auto_20190518_2120.py b/InvenTree/company/migrations/0008_auto_20190518_2120.py deleted file mode 100644 index ef9c318f52..0000000000 --- a/InvenTree/company/migrations/0008_auto_20190518_2120.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-18 11:20 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('company', '0007_supplierpart_supplierpricebreak'), - ] - - operations = [ - migrations.AlterField( - model_name='supplierpricebreak', - name='cost', - field=models.DecimalField(decimal_places=5, max_digits=10, validators=[django.core.validators.MinValueValidator(0)]), - ), - ] diff --git a/InvenTree/part/migrations/0001_initial.py b/InvenTree/part/migrations/0001_initial.py index 361436047e..c0413a909a 100644 --- a/InvenTree/part/migrations/0001_initial.py +++ b/InvenTree/part/migrations/0001_initial.py @@ -1,7 +1,7 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.12 on 2018-04-22 11:53 -from __future__ import unicode_literals +# Generated by Django 2.2 on 2019-05-18 14:04 +import InvenTree.validators +from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion @@ -13,7 +13,7 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('company', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ @@ -21,7 +21,9 @@ class Migration(migrations.Migration): name='BomItem', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('quantity', models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(0)])), + ('quantity', models.PositiveIntegerField(default=1, help_text='BOM quantity for this BOM item', validators=[django.core.validators.MinValueValidator(0)])), + ('overage', models.CharField(blank=True, help_text='Estimated build wastage quantity (absolute or percentage)', max_length=24, validators=[InvenTree.validators.validate_overage])), + ('note', models.CharField(blank=True, help_text='BOM item notes', max_length=100)), ], options={ 'verbose_name': 'BOM Item', @@ -31,18 +33,24 @@ class Migration(migrations.Migration): name='Part', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(help_text='Part name (must be unique)', max_length=100, unique=True)), + ('name', models.CharField(help_text='Part name', max_length=100, validators=[InvenTree.validators.validate_part_name])), + ('variant', models.CharField(blank=True, help_text='Part variant or revision code', max_length=32)), ('description', models.CharField(help_text='Part description', max_length=250)), + ('keywords', models.CharField(blank=True, help_text='Part keywords to improve visibility in search results', max_length=250)), ('IPN', models.CharField(blank=True, help_text='Internal Part Number', max_length=100)), ('URL', models.URLField(blank=True, help_text='Link to extenal URL')), ('image', models.ImageField(blank=True, max_length=255, null=True, upload_to=part.models.rename_part_image)), ('minimum_stock', models.PositiveIntegerField(default=0, help_text='Minimum allowed stock level', validators=[django.core.validators.MinValueValidator(0)])), - ('units', models.CharField(blank=True, default='pcs', max_length=20)), + ('units', models.CharField(blank=True, default='pcs', help_text='Stock keeping units for this part', max_length=20)), ('buildable', models.BooleanField(default=False, help_text='Can this part be built from other parts?')), + ('consumable', models.BooleanField(default=True, help_text='Can this part be used to build other parts?')), ('trackable', models.BooleanField(default=False, help_text='Does this part have tracking for unique items?')), ('purchaseable', models.BooleanField(default=True, help_text='Can this part be purchased from external suppliers?')), ('salable', models.BooleanField(default=False, help_text='Can this part be sold to customers?')), + ('active', models.BooleanField(default=True, help_text='Is this part active?')), ('notes', models.TextField(blank=True)), + ('bom_checksum', models.CharField(blank=True, help_text='Stored BOM checksum', max_length=128)), + ('bom_checked_date', models.DateField(blank=True, null=True)), ], options={ 'verbose_name': 'Part', @@ -53,8 +61,8 @@ class Migration(migrations.Migration): name='PartAttachment', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('attachment', models.FileField(blank=True, null=True, upload_to=part.models.attach_file)), - ('part', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='part.Part')), + ('attachment', models.FileField(help_text='Select file to attach', upload_to=part.models.attach_file)), + ('comment', models.CharField(help_text='File comment', max_length=100)), ], ), migrations.CreateModel( @@ -63,7 +71,7 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=100, unique=True)), ('description', models.CharField(max_length=250)), - ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='children', to='part.PartCategory')), + ('default_keywords', models.CharField(blank=True, help_text='Default keywords for parts in this category', max_length=250)), ], options={ 'verbose_name': 'Part Category', @@ -71,63 +79,11 @@ class Migration(migrations.Migration): }, ), migrations.CreateModel( - name='SupplierPart', + name='PartStar', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('SKU', models.CharField(help_text='Supplier stock keeping unit', max_length=100)), - ('manufacturer', models.CharField(blank=True, help_text='Manufacturer', max_length=100)), - ('MPN', models.CharField(blank=True, help_text='Manufacturer part number', max_length=100)), - ('URL', models.URLField(blank=True)), - ('description', models.CharField(blank=True, max_length=250)), - ('single_price', models.DecimalField(decimal_places=3, default=0, max_digits=10)), - ('base_cost', models.DecimalField(decimal_places=3, default=0, max_digits=10)), - ('packaging', models.CharField(blank=True, max_length=50)), - ('multiple', models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(0)])), - ('minimum', models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(0)])), - ('lead_time', models.DurationField(blank=True, null=True)), - ('part', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='supplier_parts', to='part.Part')), - ('supplier', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parts', to='company.Company')), + ('part', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='starred_users', to='part.Part')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='starred_parts', to=settings.AUTH_USER_MODEL)), ], ), - migrations.CreateModel( - name='SupplierPriceBreak', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('quantity', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(0)])), - ('cost', models.DecimalField(decimal_places=3, max_digits=10)), - ('part', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='price_breaks', to='part.SupplierPart')), - ], - ), - migrations.AddField( - model_name='part', - name='category', - field=models.ForeignKey(blank=True, help_text='Part category', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='parts', to='part.PartCategory'), - ), - migrations.AddField( - model_name='part', - name='default_supplier', - field=models.ForeignKey(blank=True, help_text='Default supplier part', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='default_parts', to='part.SupplierPart'), - ), - migrations.AddField( - model_name='bomitem', - name='part', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bom_items', to='part.Part'), - ), - migrations.AddField( - model_name='bomitem', - name='sub_part', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='used_in', to='part.Part'), - ), - migrations.AlterUniqueTogether( - name='supplierpricebreak', - unique_together=set([('part', 'quantity')]), - ), - migrations.AlterUniqueTogether( - name='supplierpart', - unique_together=set([('part', 'supplier', 'SKU')]), - ), - migrations.AlterUniqueTogether( - name='bomitem', - unique_together=set([('part', 'sub_part')]), - ), ] diff --git a/InvenTree/part/migrations/0002_auto_20190519_0004.py b/InvenTree/part/migrations/0002_auto_20190519_0004.py new file mode 100644 index 0000000000..02df1a7fad --- /dev/null +++ b/InvenTree/part/migrations/0002_auto_20190519_0004.py @@ -0,0 +1,77 @@ +# Generated by Django 2.2 on 2019-05-18 14:04 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('company', '0002_auto_20190519_0004'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('stock', '0001_initial'), + ('part', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='partcategory', + name='default_location', + field=models.ForeignKey(blank=True, help_text='Default location for parts in this category', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='default_categories', to='stock.StockLocation'), + ), + migrations.AddField( + model_name='partcategory', + name='parent', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='children', to='part.PartCategory'), + ), + migrations.AddField( + model_name='partattachment', + name='part', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='part.Part'), + ), + migrations.AddField( + model_name='part', + name='bom_checked_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='boms_checked', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='part', + name='category', + field=models.ForeignKey(blank=True, help_text='Part category', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='parts', to='part.PartCategory'), + ), + migrations.AddField( + model_name='part', + name='default_location', + field=models.ForeignKey(blank=True, help_text='Where is this item normally stored?', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='default_parts', to='stock.StockLocation'), + ), + migrations.AddField( + model_name='part', + name='default_supplier', + field=models.ForeignKey(blank=True, help_text='Default supplier part', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='default_parts', to='company.SupplierPart'), + ), + migrations.AddField( + model_name='bomitem', + name='part', + field=models.ForeignKey(help_text='Select parent part', limit_choices_to={'active': True, 'buildable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='bom_items', to='part.Part'), + ), + migrations.AddField( + model_name='bomitem', + name='sub_part', + field=models.ForeignKey(help_text='Select part to be used in BOM', limit_choices_to={'active': True, 'consumable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='used_in', to='part.Part'), + ), + migrations.AlterUniqueTogether( + name='partstar', + unique_together={('part', 'user')}, + ), + migrations.AlterUniqueTogether( + name='part', + unique_together={('name', 'variant')}, + ), + migrations.AlterUniqueTogether( + name='bomitem', + unique_together={('part', 'sub_part')}, + ), + ] diff --git a/InvenTree/part/migrations/0002_part_default_location.py b/InvenTree/part/migrations/0002_part_default_location.py deleted file mode 100644 index c5a65d284d..0000000000 --- a/InvenTree/part/migrations/0002_part_default_location.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.12 on 2018-04-22 11:53 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0001_initial'), - ('part', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='part', - name='default_location', - field=models.ForeignKey(blank=True, help_text='Where is this item normally stored?', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='default_parts', to='stock.StockLocation'), - ), - ] diff --git a/InvenTree/part/migrations/0003_auto_20190412_2030.py b/InvenTree/part/migrations/0003_auto_20190412_2030.py deleted file mode 100644 index 3439c09483..0000000000 --- a/InvenTree/part/migrations/0003_auto_20190412_2030.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-04-12 10:30 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0002_part_default_location'), - ] - - operations = [ - migrations.AlterField( - model_name='bomitem', - name='part', - field=models.ForeignKey(limit_choices_to={'buildable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='bom_items', to='part.Part'), - ), - ] diff --git a/InvenTree/part/migrations/0004_bomitem_note.py b/InvenTree/part/migrations/0004_bomitem_note.py deleted file mode 100644 index 69bea83175..0000000000 --- a/InvenTree/part/migrations/0004_bomitem_note.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-04-14 08:25 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0003_auto_20190412_2030'), - ] - - operations = [ - migrations.AddField( - model_name='bomitem', - name='note', - field=models.CharField(blank=True, help_text='Item notes', max_length=100), - ), - ] diff --git a/InvenTree/part/migrations/0005_part_consumable.py b/InvenTree/part/migrations/0005_part_consumable.py deleted file mode 100644 index 4bb1056ae7..0000000000 --- a/InvenTree/part/migrations/0005_part_consumable.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-04-15 13:48 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0004_bomitem_note'), - ] - - operations = [ - migrations.AddField( - model_name='part', - name='consumable', - field=models.BooleanField(default=False, help_text='Can this part be used to build other parts?'), - ), - ] diff --git a/InvenTree/part/migrations/0006_auto_20190416_2354.py b/InvenTree/part/migrations/0006_auto_20190416_2354.py deleted file mode 100644 index f2b2f42398..0000000000 --- a/InvenTree/part/migrations/0006_auto_20190416_2354.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 2.2 on 2019-04-16 13:54 - -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0005_part_consumable'), - ] - - operations = [ - migrations.AlterField( - model_name='bomitem', - name='sub_part', - field=models.ForeignKey(limit_choices_to={'consumable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='used_in', to='part.Part'), - ), - migrations.AlterField( - model_name='part', - name='consumable', - field=models.BooleanField(default=True, help_text='Can this part be used to build other parts?'), - ), - migrations.AlterField( - model_name='supplierpricebreak', - name='quantity', - field=models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(2)]), - ), - ] diff --git a/InvenTree/part/migrations/0007_auto_20190417_0007.py b/InvenTree/part/migrations/0007_auto_20190417_0007.py deleted file mode 100644 index 554a471132..0000000000 --- a/InvenTree/part/migrations/0007_auto_20190417_0007.py +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by Django 2.2 on 2019-04-16 14:07 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0006_auto_20190416_2354'), - ] - - operations = [ - migrations.AddField( - model_name='supplierpart', - name='note', - field=models.CharField(blank=True, help_text='Notes', max_length=100), - ), - migrations.AlterField( - model_name='supplierpart', - name='base_cost', - field=models.DecimalField(decimal_places=3, default=0, help_text='Minimum charge (e.g. stocking fee)', max_digits=10, validators=[django.core.validators.MinValueValidator(0)]), - ), - migrations.AlterField( - model_name='supplierpart', - name='description', - field=models.CharField(blank=True, help_text='Supplier part description', max_length=250), - ), - migrations.AlterField( - model_name='supplierpart', - name='minimum', - field=models.PositiveIntegerField(default=1, help_text='Minimum order quantity (MOQ)', validators=[django.core.validators.MinValueValidator(0)]), - ), - migrations.AlterField( - model_name='supplierpart', - name='multiple', - field=models.PositiveIntegerField(default=1, help_text='Order multiple', validators=[django.core.validators.MinValueValidator(0)]), - ), - migrations.AlterField( - model_name='supplierpart', - name='packaging', - field=models.CharField(blank=True, help_text='Part packaging', max_length=50), - ), - migrations.AlterField( - model_name='supplierpart', - name='single_price', - field=models.DecimalField(decimal_places=3, default=0, help_text='Price for single quantity', max_digits=10, validators=[django.core.validators.MinValueValidator(0)]), - ), - migrations.AlterField( - model_name='supplierpricebreak', - name='cost', - field=models.DecimalField(decimal_places=3, max_digits=10, validators=[django.core.validators.MinValueValidator(0)]), - ), - ] diff --git a/InvenTree/part/migrations/0008_auto_20190417_0013.py b/InvenTree/part/migrations/0008_auto_20190417_0013.py deleted file mode 100644 index e7311e2be8..0000000000 --- a/InvenTree/part/migrations/0008_auto_20190417_0013.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-04-16 14:13 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0007_auto_20190417_0007'), - ] - - operations = [ - migrations.AlterField( - model_name='supplierpart', - name='part', - field=models.ForeignKey(limit_choices_to={'purchasable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='supplier_parts', to='part.Part'), - ), - ] diff --git a/InvenTree/part/migrations/0009_auto_20190417_0019.py b/InvenTree/part/migrations/0009_auto_20190417_0019.py deleted file mode 100644 index 2a6eba4960..0000000000 --- a/InvenTree/part/migrations/0009_auto_20190417_0019.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-04-16 14:19 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0008_auto_20190417_0013'), - ] - - operations = [ - migrations.AlterField( - model_name='supplierpart', - name='part', - field=models.ForeignKey(limit_choices_to={'purchaseable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='supplier_parts', to='part.Part'), - ), - ] diff --git a/InvenTree/part/migrations/0010_auto_20190417_0045.py b/InvenTree/part/migrations/0010_auto_20190417_0045.py deleted file mode 100644 index 1040afc67c..0000000000 --- a/InvenTree/part/migrations/0010_auto_20190417_0045.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.2 on 2019-04-16 14:45 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0009_auto_20190417_0019'), - ] - - operations = [ - migrations.AlterField( - model_name='supplierpart', - name='minimum', - field=models.PositiveIntegerField(default=1, help_text='Minimum order quantity (MOQ)', validators=[django.core.validators.MinValueValidator(1)]), - ), - migrations.AlterField( - model_name='supplierpart', - name='multiple', - field=models.PositiveIntegerField(default=1, help_text='Order multiple', validators=[django.core.validators.MinValueValidator(1)]), - ), - ] diff --git a/InvenTree/part/migrations/0011_auto_20190428_0841.py b/InvenTree/part/migrations/0011_auto_20190428_0841.py deleted file mode 100644 index 0146b6795a..0000000000 --- a/InvenTree/part/migrations/0011_auto_20190428_0841.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-04-27 22:41 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0010_auto_20190417_0045'), - ] - - operations = [ - migrations.AlterField( - model_name='supplierpart', - name='supplier', - field=models.ForeignKey(limit_choices_to={'is_supplier': True}, on_delete=django.db.models.deletion.CASCADE, related_name='parts', to='company.Company'), - ), - ] diff --git a/InvenTree/part/migrations/0012_part_active.py b/InvenTree/part/migrations/0012_part_active.py deleted file mode 100644 index 87929e2f85..0000000000 --- a/InvenTree/part/migrations/0012_part_active.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 2.2 on 2019-04-28 13:00 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0011_auto_20190428_0841'), - ] - - operations = [ - migrations.AddField( - model_name='part', - name='active', - field=models.BooleanField(default=True, help_text='Is this part active?'), - ), - migrations.AddField( - model_name='partattachment', - name='comment', - field=models.CharField(blank=True, help_text='File comment', max_length=100), - ), - ] diff --git a/InvenTree/part/migrations/0013_auto_20190429_2229.py b/InvenTree/part/migrations/0013_auto_20190429_2229.py deleted file mode 100644 index 9c339b18b1..0000000000 --- a/InvenTree/part/migrations/0013_auto_20190429_2229.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-04-29 12:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0012_part_active'), - ] - - operations = [ - migrations.AlterField( - model_name='part', - name='URL', - field=models.URLField(blank=True, help_text='Link to external URL'), - ), - ] diff --git a/InvenTree/part/migrations/0014_auto_20190502_2039.py b/InvenTree/part/migrations/0014_auto_20190502_2039.py deleted file mode 100644 index c32c3afe32..0000000000 --- a/InvenTree/part/migrations/0014_auto_20190502_2039.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-05-02 10:39 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0013_auto_20190429_2229'), - ] - - operations = [ - migrations.AlterField( - model_name='part', - name='URL', - field=models.URLField(blank=True, help_text='Link to extenal URL'), - ), - ] diff --git a/InvenTree/part/migrations/0015_partcategory_default_location.py b/InvenTree/part/migrations/0015_partcategory_default_location.py deleted file mode 100644 index 33a47cc440..0000000000 --- a/InvenTree/part/migrations/0015_partcategory_default_location.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 2.2 on 2019-05-04 08:57 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0013_remove_stockitem_uuid'), - ('part', '0014_auto_20190502_2039'), - ] - - operations = [ - migrations.AddField( - model_name='partcategory', - name='default_location', - field=models.ForeignKey(blank=True, help_text='Default location for parts in this category', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='default_categories', to='stock.StockLocation'), - ), - ] diff --git a/InvenTree/part/migrations/0016_partstar.py b/InvenTree/part/migrations/0016_partstar.py deleted file mode 100644 index baa5c83d5b..0000000000 --- a/InvenTree/part/migrations/0016_partstar.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.2 on 2019-05-04 22:45 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('part', '0015_partcategory_default_location'), - ] - - operations = [ - migrations.CreateModel( - name='PartStar', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('part', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='starred_users', to='part.Part')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='starred_parts', to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/InvenTree/part/migrations/0017_auto_20190505_0848.py b/InvenTree/part/migrations/0017_auto_20190505_0848.py deleted file mode 100644 index 90162132f9..0000000000 --- a/InvenTree/part/migrations/0017_auto_20190505_0848.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-04 22:48 - -from django.conf import settings -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('part', '0016_partstar'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='partstar', - unique_together={('part', 'user')}, - ), - ] diff --git a/InvenTree/part/migrations/0018_auto_20190505_2231.py b/InvenTree/part/migrations/0018_auto_20190505_2231.py deleted file mode 100644 index 32aa1e3a1b..0000000000 --- a/InvenTree/part/migrations/0018_auto_20190505_2231.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.2 on 2019-05-05 12:31 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0017_auto_20190505_0848'), - ] - - operations = [ - migrations.AlterField( - model_name='bomitem', - name='part', - field=models.ForeignKey(limit_choices_to={'active': True, 'buildable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='bom_items', to='part.Part'), - ), - migrations.AlterField( - model_name='bomitem', - name='sub_part', - field=models.ForeignKey(limit_choices_to={'active': True, 'consumable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='used_in', to='part.Part'), - ), - ] diff --git a/InvenTree/part/migrations/0020_auto_20190510_2022.py b/InvenTree/part/migrations/0020_auto_20190510_2022.py deleted file mode 100644 index 8bf6db8f18..0000000000 --- a/InvenTree/part/migrations/0020_auto_20190510_2022.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 2.2 on 2019-05-10 10:22 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0019_auto_20190508_2332'), - ] - - operations = [ - migrations.AddField( - model_name='part', - name='variant', - field=models.CharField(blank=True, help_text='Part variant or revision code', max_length=32), - ), - migrations.AlterField( - model_name='part', - name='name', - field=models.CharField(help_text='Part name', max_length=100), - ), - migrations.AlterUniqueTogether( - name='part', - unique_together={('name', 'variant')}, - ), - ] diff --git a/InvenTree/part/migrations/0021_auto_20190510_2220.py b/InvenTree/part/migrations/0021_auto_20190510_2220.py deleted file mode 100644 index 294bd112ae..0000000000 --- a/InvenTree/part/migrations/0021_auto_20190510_2220.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-10 12:20 - -import InvenTree.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0020_auto_20190510_2022'), - ] - - operations = [ - migrations.AlterField( - model_name='part', - name='name', - field=models.CharField(help_text='Part name', max_length=100, validators=[InvenTree.validators.validate_part_name]), - ), - ] diff --git a/InvenTree/part/migrations/0022_auto_20190512_1246.py b/InvenTree/part/migrations/0022_auto_20190512_1246.py deleted file mode 100644 index 40f4d0dd4c..0000000000 --- a/InvenTree/part/migrations/0022_auto_20190512_1246.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 2.2 on 2019-05-12 02:46 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('part', '0021_auto_20190510_2220'), - ] - - operations = [ - migrations.AddField( - model_name='part', - name='bom_checked_by', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='boms_checked', to=settings.AUTH_USER_MODEL), - ), - migrations.AddField( - model_name='part', - name='bom_checked_date', - field=models.DateField(blank=True, null=True), - ), - migrations.AddField( - model_name='part', - name='bom_checksum', - field=models.CharField(blank=True, help_text='Stored BOM checksum', max_length=128), - ), - ] diff --git a/InvenTree/part/migrations/0023_part_keywords.py b/InvenTree/part/migrations/0023_part_keywords.py deleted file mode 100644 index 4752d80740..0000000000 --- a/InvenTree/part/migrations/0023_part_keywords.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-05-14 07:15 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0022_auto_20190512_1246'), - ] - - operations = [ - migrations.AddField( - model_name='part', - name='keywords', - field=models.CharField(blank=True, help_text='Part keywords to improve visibility in search results', max_length=250), - ), - ] diff --git a/InvenTree/part/migrations/0024_partcategory_default_keywords.py b/InvenTree/part/migrations/0024_partcategory_default_keywords.py deleted file mode 100644 index 317d982f7d..0000000000 --- a/InvenTree/part/migrations/0024_partcategory_default_keywords.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-05-14 07:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0023_part_keywords'), - ] - - operations = [ - migrations.AddField( - model_name='partcategory', - name='default_keywords', - field=models.CharField(blank=True, help_text='Default keywords for parts in this category', max_length=250), - ), - ] diff --git a/InvenTree/part/migrations/0025_auto_20190515_0012.py b/InvenTree/part/migrations/0025_auto_20190515_0012.py deleted file mode 100644 index aaeb8ea1a3..0000000000 --- a/InvenTree/part/migrations/0025_auto_20190515_0012.py +++ /dev/null @@ -1,46 +0,0 @@ -# Generated by Django 2.2 on 2019-05-14 14:12 - -import InvenTree.validators -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0024_partcategory_default_keywords'), - ] - - operations = [ - migrations.AddField( - model_name='bomitem', - name='overage', - field=models.CharField(blank=True, help_text='Estimated build wastage quantity (absolute or percentage)', max_length=24, validators=[InvenTree.validators.validate_overage]), - ), - migrations.AlterField( - model_name='bomitem', - name='note', - field=models.CharField(blank=True, help_text='BOM item notes', max_length=100), - ), - migrations.AlterField( - model_name='bomitem', - name='part', - field=models.ForeignKey(help_text='Select parent part', limit_choices_to={'active': True, 'buildable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='bom_items', to='part.Part'), - ), - migrations.AlterField( - model_name='bomitem', - name='quantity', - field=models.PositiveIntegerField(default=1, help_text='BOM quantity for this BOM item', validators=[django.core.validators.MinValueValidator(0)]), - ), - migrations.AlterField( - model_name='bomitem', - name='sub_part', - field=models.ForeignKey(help_text='Select part to be used in BOM', limit_choices_to={'active': True, 'consumable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='used_in', to='part.Part'), - ), - migrations.AlterField( - model_name='supplierpart', - name='URL', - field=models.URLField(blank=True, help_text='URL for external supplier part link'), - ), - ] diff --git a/InvenTree/part/migrations/0026_remove_supplierpart_single_price.py b/InvenTree/part/migrations/0026_remove_supplierpart_single_price.py deleted file mode 100644 index f0bde887a4..0000000000 --- a/InvenTree/part/migrations/0026_remove_supplierpart_single_price.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 2.2 on 2019-05-18 05:43 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0025_auto_20190515_0012'), - ] - - operations = [ - migrations.RemoveField( - model_name='supplierpart', - name='single_price', - ), - ] diff --git a/InvenTree/part/migrations/0027_auto_20190518_1620.py b/InvenTree/part/migrations/0027_auto_20190518_1620.py deleted file mode 100644 index 85ed3e6be2..0000000000 --- a/InvenTree/part/migrations/0027_auto_20190518_1620.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-05-18 06:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0026_remove_supplierpart_single_price'), - ] - - operations = [ - migrations.AlterField( - model_name='partattachment', - name='comment', - field=models.CharField(help_text='File comment', max_length=100), - ), - ] diff --git a/InvenTree/part/migrations/0028_auto_20190518_1627.py b/InvenTree/part/migrations/0028_auto_20190518_1627.py deleted file mode 100644 index fa0fa1457c..0000000000 --- a/InvenTree/part/migrations/0028_auto_20190518_1627.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-18 06:27 - -from django.db import migrations, models -import part.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0027_auto_20190518_1620'), - ] - - operations = [ - migrations.AlterField( - model_name='partattachment', - name='attachment', - field=models.FileField(help_text='Select file to attach', upload_to=part.models.attach_file), - ), - ] diff --git a/InvenTree/part/migrations/0029_auto_20190518_1632.py b/InvenTree/part/migrations/0029_auto_20190518_1632.py deleted file mode 100644 index a5a2d61809..0000000000 --- a/InvenTree/part/migrations/0029_auto_20190518_1632.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-18 06:32 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0028_auto_20190518_1627'), - ] - - operations = [ - migrations.AlterField( - model_name='supplierpricebreak', - name='quantity', - field=models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1)]), - ), - ] diff --git a/InvenTree/part/migrations/0030_auto_20190518_1641.py b/InvenTree/part/migrations/0030_auto_20190518_1641.py deleted file mode 100644 index 7661dd6412..0000000000 --- a/InvenTree/part/migrations/0030_auto_20190518_1641.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-18 06:41 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0029_auto_20190518_1632'), - ] - - operations = [ - migrations.AlterField( - model_name='supplierpricebreak', - name='part', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pricebreaks', to='part.SupplierPart'), - ), - ] diff --git a/InvenTree/part/migrations/0031_auto_20190518_1650.py b/InvenTree/part/migrations/0031_auto_20190518_1650.py deleted file mode 100644 index 67c6d6124f..0000000000 --- a/InvenTree/part/migrations/0031_auto_20190518_1650.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-18 06:50 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('part', '0030_auto_20190518_1641'), - ] - - operations = [ - migrations.AlterField( - model_name='supplierpricebreak', - name='quantity', - field=models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1)]), - ), - ] diff --git a/InvenTree/part/migrations/0032_auto_20190518_1759.py b/InvenTree/part/migrations/0032_auto_20190518_1759.py deleted file mode 100644 index 8a82961947..0000000000 --- a/InvenTree/part/migrations/0032_auto_20190518_1759.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 2.2 on 2019-05-18 07:59 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0017_auto_20190518_1759'), - ('part', '0031_auto_20190518_1650'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='supplierpricebreak', - unique_together=None, - ), - migrations.RemoveField( - model_name='supplierpricebreak', - name='part', - ), - migrations.AlterField( - model_name='part', - name='default_supplier', - field=models.ForeignKey(blank=True, help_text='Default supplier part', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='default_parts', to='company.SupplierPart'), - ), - migrations.DeleteModel( - name='SupplierPart', - ), - migrations.DeleteModel( - name='SupplierPriceBreak', - ), - ] diff --git a/InvenTree/stock/migrations/0001_initial.py b/InvenTree/stock/migrations/0001_initial.py index b4d15a7f64..2fc4e96608 100644 --- a/InvenTree/stock/migrations/0001_initial.py +++ b/InvenTree/stock/migrations/0001_initial.py @@ -1,6 +1,4 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.12 on 2018-04-22 11:53 -from __future__ import unicode_literals +# Generated by Django 2.2 on 2019-05-18 14:04 from django.conf import settings import django.core.validators @@ -14,8 +12,8 @@ class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('part', '0001_initial'), ('company', '0001_initial'), + ('part', '0001_initial'), ] operations = [ @@ -25,30 +23,19 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('serial', models.PositiveIntegerField(blank=True, help_text='Serial number for this item', null=True)), ('URL', models.URLField(blank=True, max_length=125)), - ('batch', models.CharField(blank=True, help_text='Batch code for this stock item', max_length=100)), - ('quantity', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(0)])), - ('updated', models.DateField(auto_now=True)), + ('batch', models.CharField(blank=True, help_text='Batch code for this stock item', max_length=100, null=True)), + ('quantity', models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(0)])), + ('updated', models.DateField(auto_now=True, null=True)), ('stocktake_date', models.DateField(blank=True, null=True)), ('review_needed', models.BooleanField(default=False)), - ('status', models.PositiveIntegerField(choices=[(10, 'OK'), (60, 'Destroyed'), (50, 'Attention needed'), (55, 'Damaged')], default=10, validators=[django.core.validators.MinValueValidator(0)])), - ('notes', models.TextField(blank=True)), + ('delete_on_deplete', models.BooleanField(default=True, help_text='Delete this Stock Item when stock is depleted')), + ('status', models.PositiveIntegerField(choices=[(10, 'OK'), (50, 'Attention needed'), (55, 'Damaged'), (60, 'Destroyed')], default=10, validators=[django.core.validators.MinValueValidator(0)])), + ('notes', models.CharField(blank=True, help_text='Stock Item Notes', max_length=250)), ('infinite', models.BooleanField(default=False)), ('belongs_to', models.ForeignKey(blank=True, help_text='Is this item installed in another item?', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='owned_parts', to='stock.StockItem')), ('customer', models.ForeignKey(blank=True, help_text='Item assigned to customer?', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stockitems', to='company.Company')), ], ), - migrations.CreateModel( - name='StockItemTracking', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField(auto_now_add=True)), - ('title', models.CharField(max_length=250)), - ('notes', models.TextField(blank=True)), - ('system', models.BooleanField(default=False)), - ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tracking_info', to='stock.StockItem')), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), - ], - ), migrations.CreateModel( name='StockLocation', fields=[ @@ -59,34 +46,44 @@ class Migration(migrations.Migration): ], options={ 'abstract': False, + 'unique_together': {('name', 'parent')}, }, ), + migrations.CreateModel( + name='StockItemTracking', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('date', models.DateTimeField(auto_now_add=True)), + ('title', models.CharField(max_length=250)), + ('notes', models.TextField(blank=True)), + ('system', models.BooleanField(default=False)), + ('quantity', models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(0)])), + ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tracking_info', to='stock.StockItem')), + ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), + ], + ), migrations.AddField( model_name='stockitem', name='location', - field=models.ForeignKey(blank=True, help_text='Where is this stock item located?', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='items', to='stock.StockLocation'), + field=models.ForeignKey(blank=True, help_text='Where is this stock item located?', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='stock_items', to='stock.StockLocation'), ), migrations.AddField( model_name='stockitem', name='part', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='locations', to='part.Part'), + field=models.ForeignKey(help_text='Base part', on_delete=django.db.models.deletion.CASCADE, related_name='locations', to='part.Part'), ), migrations.AddField( model_name='stockitem', name='stocktake_user', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL), + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stocktake_stock', to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='stockitem', name='supplier_part', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='part.SupplierPart'), - ), - migrations.AlterUniqueTogether( - name='stocklocation', - unique_together=set([('name', 'parent')]), + field=models.ForeignKey(blank=True, help_text='Select a matching supplier part for this stock item', null=True, on_delete=django.db.models.deletion.SET_NULL, to='company.SupplierPart'), ), migrations.AlterUniqueTogether( name='stockitem', - unique_together=set([('part', 'serial')]), + unique_together={('part', 'serial')}, ), ] diff --git a/InvenTree/stock/migrations/0002_auto_20180430_1218.py b/InvenTree/stock/migrations/0002_auto_20180430_1218.py deleted file mode 100644 index a3ed70090f..0000000000 --- a/InvenTree/stock/migrations/0002_auto_20180430_1218.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.12 on 2018-04-30 12:18 -from __future__ import unicode_literals - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='stockitem', - name='quantity', - field=models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(0)]), - ), - ] diff --git a/InvenTree/stock/migrations/0003_auto_20180510_1042.py b/InvenTree/stock/migrations/0003_auto_20180510_1042.py deleted file mode 100644 index dfa34c6b5c..0000000000 --- a/InvenTree/stock/migrations/0003_auto_20180510_1042.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.12 on 2018-05-10 10:42 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0002_auto_20180430_1218'), - ] - - operations = [ - migrations.AlterField( - model_name='stockitemtracking', - name='date', - field=models.DateTimeField(auto_now_add=True), - ), - ] diff --git a/InvenTree/stock/migrations/0004_auto_20190412_2030.py b/InvenTree/stock/migrations/0004_auto_20190412_2030.py deleted file mode 100644 index d55dbc6fff..0000000000 --- a/InvenTree/stock/migrations/0004_auto_20190412_2030.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-04-12 10:30 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0003_auto_20180510_1042'), - ] - - operations = [ - migrations.AlterField( - model_name='stockitem', - name='status', - field=models.PositiveIntegerField(choices=[(10, 'OK'), (50, 'Attention needed'), (55, 'Damaged'), (60, 'Destroyed')], default=10, validators=[django.core.validators.MinValueValidator(0)]), - ), - ] diff --git a/InvenTree/stock/migrations/0005_stockitemtracking_quantity.py b/InvenTree/stock/migrations/0005_stockitemtracking_quantity.py deleted file mode 100644 index f654486075..0000000000 --- a/InvenTree/stock/migrations/0005_stockitemtracking_quantity.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-04-12 14:09 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0004_auto_20190412_2030'), - ] - - operations = [ - migrations.AddField( - model_name='stockitemtracking', - name='quantity', - field=models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(0)]), - ), - ] diff --git a/InvenTree/stock/migrations/0006_stockitem_uuid.py b/InvenTree/stock/migrations/0006_stockitem_uuid.py deleted file mode 100644 index 4d358e7201..0000000000 --- a/InvenTree/stock/migrations/0006_stockitem_uuid.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-04-12 15:06 - -from django.db import migrations, models -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0005_stockitemtracking_quantity'), - ] - - operations = [ - migrations.AddField( - model_name='stockitem', - name='uuid', - field=models.UUIDField(blank=True, default=uuid.uuid4, editable=False), - ), - ] diff --git a/InvenTree/stock/migrations/0007_auto_20190417_1812.py b/InvenTree/stock/migrations/0007_auto_20190417_1812.py deleted file mode 100644 index 8b9ec638e3..0000000000 --- a/InvenTree/stock/migrations/0007_auto_20190417_1812.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-04-17 08:12 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0006_stockitem_uuid'), - ] - - operations = [ - migrations.AlterField( - model_name='stockitem', - name='notes', - field=models.CharField(blank=True, help_text='Stock Item Notes', max_length=250), - ), - ] diff --git a/InvenTree/stock/migrations/0008_auto_20190417_1819.py b/InvenTree/stock/migrations/0008_auto_20190417_1819.py deleted file mode 100644 index 46659abd66..0000000000 --- a/InvenTree/stock/migrations/0008_auto_20190417_1819.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 2.2 on 2019-04-17 08:19 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0007_auto_20190417_1812'), - ] - - operations = [ - migrations.AlterField( - model_name='stockitem', - name='stocktake_user', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stocktake_stock', to=settings.AUTH_USER_MODEL), - ), - ] diff --git a/InvenTree/stock/migrations/0009_auto_20190428_0841.py b/InvenTree/stock/migrations/0009_auto_20190428_0841.py deleted file mode 100644 index 4e22dad76b..0000000000 --- a/InvenTree/stock/migrations/0009_auto_20190428_0841.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-04-27 22:41 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0008_auto_20190417_1819'), - ] - - operations = [ - migrations.AlterField( - model_name='stockitem', - name='location', - field=models.ForeignKey(blank=True, help_text='Where is this stock item located?', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='stock_items', to='stock.StockLocation'), - ), - ] diff --git a/InvenTree/stock/migrations/0010_auto_20190501_2344.py b/InvenTree/stock/migrations/0010_auto_20190501_2344.py deleted file mode 100644 index 61ea730b03..0000000000 --- a/InvenTree/stock/migrations/0010_auto_20190501_2344.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-05-01 13:44 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0009_auto_20190428_0841'), - ] - - operations = [ - migrations.AlterField( - model_name='stockitem', - name='batch', - field=models.CharField(blank=True, help_text='Batch code for this stock item', max_length=100, null=True), - ), - ] diff --git a/InvenTree/stock/migrations/0011_auto_20190502_0041.py b/InvenTree/stock/migrations/0011_auto_20190502_0041.py deleted file mode 100644 index b540421de5..0000000000 --- a/InvenTree/stock/migrations/0011_auto_20190502_0041.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-01 14:41 - -from django.db import migrations, models -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0010_auto_20190501_2344'), - ] - - operations = [ - migrations.AlterField( - model_name='stockitem', - name='uuid', - field=models.UUIDField(blank=True, default=uuid.uuid4, editable=False, help_text='Unique ID for the StockItem'), - ), - ] diff --git a/InvenTree/stock/migrations/0012_auto_20190502_0058.py b/InvenTree/stock/migrations/0012_auto_20190502_0058.py deleted file mode 100644 index 1c86926fcd..0000000000 --- a/InvenTree/stock/migrations/0012_auto_20190502_0058.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-01 14:58 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0011_auto_20190502_0041'), - ] - - operations = [ - migrations.AlterField( - model_name='stockitem', - name='part', - field=models.ForeignKey(help_text='Base part', on_delete=django.db.models.deletion.CASCADE, related_name='locations', to='part.Part'), - ), - ] diff --git a/InvenTree/stock/migrations/0013_remove_stockitem_uuid.py b/InvenTree/stock/migrations/0013_remove_stockitem_uuid.py deleted file mode 100644 index 79184862ed..0000000000 --- a/InvenTree/stock/migrations/0013_remove_stockitem_uuid.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 2.2 on 2019-05-02 10:39 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0012_auto_20190502_0058'), - ] - - operations = [ - migrations.RemoveField( - model_name='stockitem', - name='uuid', - ), - ] diff --git a/InvenTree/stock/migrations/0014_auto_20190508_2332.py b/InvenTree/stock/migrations/0014_auto_20190508_2332.py deleted file mode 100644 index 829bd34df8..0000000000 --- a/InvenTree/stock/migrations/0014_auto_20190508_2332.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-08 13:32 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0013_remove_stockitem_uuid'), - ] - - operations = [ - migrations.AlterField( - model_name='stockitem', - name='supplier_part', - field=models.ForeignKey(blank=True, help_text='Select a matching supplier part for this stock item', null=True, on_delete=django.db.models.deletion.SET_NULL, to='part.SupplierPart'), - ), - ] diff --git a/InvenTree/stock/migrations/0015_stockitem_delete_on_deplete.py b/InvenTree/stock/migrations/0015_stockitem_delete_on_deplete.py deleted file mode 100644 index 29631b94d8..0000000000 --- a/InvenTree/stock/migrations/0015_stockitem_delete_on_deplete.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-05-09 12:59 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0014_auto_20190508_2332'), - ] - - operations = [ - migrations.AddField( - model_name='stockitem', - name='delete_on_deplete', - field=models.BooleanField(default=True, help_text='Delete this Stock Item when stock is depleted'), - ), - ] diff --git a/InvenTree/stock/migrations/0016_auto_20190512_2119.py b/InvenTree/stock/migrations/0016_auto_20190512_2119.py deleted file mode 100644 index 582e68d277..0000000000 --- a/InvenTree/stock/migrations/0016_auto_20190512_2119.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2 on 2019-05-12 11:19 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0015_stockitem_delete_on_deplete'), - ] - - operations = [ - migrations.AlterField( - model_name='stockitem', - name='updated', - field=models.DateField(auto_now=True, null=True), - ), - ] diff --git a/InvenTree/stock/migrations/0017_auto_20190518_1759.py b/InvenTree/stock/migrations/0017_auto_20190518_1759.py deleted file mode 100644 index c0e583999e..0000000000 --- a/InvenTree/stock/migrations/0017_auto_20190518_1759.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2 on 2019-05-18 07:59 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('stock', '0016_auto_20190512_2119'), - ] - - operations = [ - migrations.AlterField( - model_name='stockitem', - name='supplier_part', - field=models.ForeignKey(blank=True, help_text='Select a matching supplier part for this stock item', null=True, on_delete=django.db.models.deletion.SET_NULL, to='company.SupplierPart'), - ), - ] diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 04e814707e..fcb1622f27 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -22,7 +22,6 @@ from InvenTree import helpers from InvenTree.models import InvenTreeTree from part.models import Part -from company.models import SupplierPart class StockLocation(InvenTreeTree):