From 40d8332e7f30d91f5fb477ae8c7b5816b933982f Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 8 May 2019 07:48:39 +1000 Subject: [PATCH] Add 'allocated' status code to build - This means that parts have been taken from stock --- .../migrations/0011_auto_20190508_0748.py | 19 +++++++++++++++++++ InvenTree/build/models.py | 2 ++ InvenTree/templates/build_status.html | 4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 InvenTree/build/migrations/0011_auto_20190508_0748.py diff --git a/InvenTree/build/migrations/0011_auto_20190508_0748.py b/InvenTree/build/migrations/0011_auto_20190508_0748.py new file mode 100644 index 0000000000..e4c0ec5fa7 --- /dev/null +++ b/InvenTree/build/migrations/0011_auto_20190508_0748.py @@ -0,0 +1,19 @@ +# 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/models.py b/InvenTree/build/models.py index 56f63db2e7..d4a8e70448 100644 --- a/InvenTree/build/models.py +++ b/InvenTree/build/models.py @@ -62,11 +62,13 @@ class Build(models.Model): # Build status codes PENDING = 10 # Build is pending / active + ALLOCATED = 20 # Parts have been removed from stock CANCELLED = 30 # Build was cancelled COMPLETE = 40 # Build is complete #: Build status codes BUILD_STATUS_CODES = {PENDING: _("Pending"), + ALLOCATED: _("Allocated"), CANCELLED: _("Cancelled"), COMPLETE: _("Complete"), } diff --git a/InvenTree/templates/build_status.html b/InvenTree/templates/build_status.html index 1702ceccae..3fc5f6086c 100644 --- a/InvenTree/templates/build_status.html +++ b/InvenTree/templates/build_status.html @@ -1,7 +1,7 @@ {% if build.status == build.PENDING %} -{% elif build.status == build.HOLDING %} - +{% elif build.status == build.ALLOCATED %} + {% elif build.status == build.CANCELLED %} {% elif build.status == build.COMPLETE %}