From d8d3509b5ea1d35cf1abd1e978b3366ca2d88bcf Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 18 Apr 2018 01:16:30 +1000 Subject: [PATCH] Changes 'notes' fields to be textfield - not charfield --- InvenTree/InvenTree/models.py | 8 ++++-- .../migrations/0011_auto_20180417_1514.py | 21 +++++++++++++++ .../migrations/0012_auto_20180417_1516.py | 20 ++++++++++++++ InvenTree/build/models.py | 2 +- .../migrations/0003_auto_20180417_1514.py | 26 +++++++++++++++++++ .../migrations/0004_auto_20180417_1516.py | 20 ++++++++++++++ .../migrations/0015_auto_20180417_1514.py | 21 +++++++++++++++ .../migrations/0016_auto_20180417_1516.py | 20 ++++++++++++++ InvenTree/stock/models.py | 2 +- .../migrations/0009_auto_20180417_1516.py | 25 ++++++++++++++++++ 10 files changed, 161 insertions(+), 4 deletions(-) create mode 100644 InvenTree/build/migrations/0011_auto_20180417_1514.py create mode 100644 InvenTree/build/migrations/0012_auto_20180417_1516.py create mode 100644 InvenTree/customer/migrations/0003_auto_20180417_1514.py create mode 100644 InvenTree/customer/migrations/0004_auto_20180417_1516.py create mode 100644 InvenTree/stock/migrations/0015_auto_20180417_1514.py create mode 100644 InvenTree/stock/migrations/0016_auto_20180417_1516.py create mode 100644 InvenTree/supplier/migrations/0009_auto_20180417_1516.py diff --git a/InvenTree/InvenTree/models.py b/InvenTree/InvenTree/models.py index 06bf758b84..36c5f26d70 100644 --- a/InvenTree/InvenTree/models.py +++ b/InvenTree/InvenTree/models.py @@ -16,17 +16,21 @@ class Company(models.Model): abstract = True name = models.CharField(max_length=100, unique=True) + description = models.CharField(max_length=500) + website = models.URLField(blank=True) + address = models.CharField(max_length=200, blank=True) phone = models.CharField(max_length=50, blank=True) email = models.EmailField(blank=True) + contact = models.CharField(max_length=100, blank=True) - notes = models.CharField(max_length=500, - blank=True) + + notes = models.TextField(blank=True) def __str__(self): return self.name diff --git a/InvenTree/build/migrations/0011_auto_20180417_1514.py b/InvenTree/build/migrations/0011_auto_20180417_1514.py new file mode 100644 index 0000000000..4ecfce80d5 --- /dev/null +++ b/InvenTree/build/migrations/0011_auto_20180417_1514.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.12 on 2018-04-17 15:14 +from __future__ import unicode_literals + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('build', '0010_auto_20180418_0028'), + ] + + operations = [ + migrations.AlterField( + model_name='build', + name='status', + field=models.PositiveIntegerField(choices=[(40, 'Complete'), (10, 'Pending'), (20, 'Holding'), (30, 'Cancelled')], default=10, validators=[django.core.validators.MinValueValidator(0)]), + ), + ] diff --git a/InvenTree/build/migrations/0012_auto_20180417_1516.py b/InvenTree/build/migrations/0012_auto_20180417_1516.py new file mode 100644 index 0000000000..e3e75c3f47 --- /dev/null +++ b/InvenTree/build/migrations/0012_auto_20180417_1516.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.12 on 2018-04-17 15:16 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('build', '0011_auto_20180417_1514'), + ] + + operations = [ + migrations.AlterField( + model_name='build', + name='notes', + field=models.TextField(blank=True), + ), + ] diff --git a/InvenTree/build/models.py b/InvenTree/build/models.py index ed65124ee5..32bd2e8464 100644 --- a/InvenTree/build/models.py +++ b/InvenTree/build/models.py @@ -60,7 +60,7 @@ class Build(models.Model): help_text='Number of parts to build') # Notes can be attached to each build output - notes = models.CharField(max_length=500, blank=True) + notes = models.TextField(blank=True) @property def is_active(self): diff --git a/InvenTree/customer/migrations/0003_auto_20180417_1514.py b/InvenTree/customer/migrations/0003_auto_20180417_1514.py new file mode 100644 index 0000000000..19e63adbd6 --- /dev/null +++ b/InvenTree/customer/migrations/0003_auto_20180417_1514.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.12 on 2018-04-17 15:14 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('customer', '0002_auto_20180418_0028'), + ] + + operations = [ + migrations.AlterField( + model_name='customerorderline', + name='customer_order', + field=models.ForeignKey(help_text=b'Order this line belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='lines', to='customer.CustomerOrder'), + ), + migrations.AlterField( + model_name='customerorderline', + name='part', + field=models.ForeignKey(blank=True, help_text=b'Part', on_delete=django.db.models.deletion.CASCADE, to='part.Part'), + ), + ] diff --git a/InvenTree/customer/migrations/0004_auto_20180417_1516.py b/InvenTree/customer/migrations/0004_auto_20180417_1516.py new file mode 100644 index 0000000000..9089a3fc82 --- /dev/null +++ b/InvenTree/customer/migrations/0004_auto_20180417_1516.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.12 on 2018-04-17 15:16 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('customer', '0003_auto_20180417_1514'), + ] + + operations = [ + migrations.AlterField( + model_name='customer', + name='notes', + field=models.TextField(blank=True), + ), + ] diff --git a/InvenTree/stock/migrations/0015_auto_20180417_1514.py b/InvenTree/stock/migrations/0015_auto_20180417_1514.py new file mode 100644 index 0000000000..b55cc6aa28 --- /dev/null +++ b/InvenTree/stock/migrations/0015_auto_20180417_1514.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.12 on 2018-04-17 15:14 +from __future__ import unicode_literals + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('stock', '0014_auto_20180418_0028'), + ] + + operations = [ + migrations.AlterField( + model_name='stockitem', + name='status', + field=models.PositiveIntegerField(choices=[(10, 'OK'), (60, 'Destroyed'), (50, 'Attention needed'), (55, 'Damaged')], default=10, validators=[django.core.validators.MinValueValidator(0)]), + ), + ] diff --git a/InvenTree/stock/migrations/0016_auto_20180417_1516.py b/InvenTree/stock/migrations/0016_auto_20180417_1516.py new file mode 100644 index 0000000000..c128ee54d0 --- /dev/null +++ b/InvenTree/stock/migrations/0016_auto_20180417_1516.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.12 on 2018-04-17 15:16 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('stock', '0015_auto_20180417_1514'), + ] + + operations = [ + migrations.AlterField( + model_name='stockitem', + name='notes', + field=models.TextField(blank=True), + ), + ] diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 608e38dc83..0d509cab5c 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -131,7 +131,7 @@ class StockItem(models.Model): choices=ITEM_STATUS_CODES.items(), validators=[MinValueValidator(0)]) - notes = models.CharField(max_length=100, blank=True) + notes = models.TextField(blank=True) # If stock item is incoming, an (optional) ETA field # expected_arrival = models.DateField(null=True, blank=True) diff --git a/InvenTree/supplier/migrations/0009_auto_20180417_1516.py b/InvenTree/supplier/migrations/0009_auto_20180417_1516.py new file mode 100644 index 0000000000..2a503ef682 --- /dev/null +++ b/InvenTree/supplier/migrations/0009_auto_20180417_1516.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.12 on 2018-04-17 15:16 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('supplier', '0008_delete_customer'), + ] + + operations = [ + migrations.AlterField( + model_name='manufacturer', + name='notes', + field=models.TextField(blank=True), + ), + migrations.AlterField( + model_name='supplier', + name='notes', + field=models.TextField(blank=True), + ), + ]