Add 'allocated' status code to build

- This means that parts have been taken from stock
This commit is contained in:
Oliver Walters 2019-05-08 07:48:39 +10:00
parent cd514bf1db
commit 40d8332e7f
3 changed files with 23 additions and 2 deletions

View File

@ -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)]),
),
]

View File

@ -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"),
}

View File

@ -1,7 +1,7 @@
{% if build.status == build.PENDING %}
<span class='label label-info'>
{% elif build.status == build.HOLDING %}
<span class='label label-warning'>
{% elif build.status == build.ALLOCATED %}
<span class='label label-primary'>
{% elif build.status == build.CANCELLED %}
<span class='label label-danger'>
{% elif build.status == build.COMPLETE %}