Change "ALLOCATED" to "PRODUCTION"

This commit is contained in:
Oliver Walters 2020-10-20 21:10:36 +11:00
parent ac79e131bc
commit 2df0f03a9a
3 changed files with 32 additions and 4 deletions

View File

@ -214,25 +214,25 @@ class BuildStatus(StatusCode):
# Build status codes
PENDING = 10 # Build is pending / active
ALLOCATED = 20 # Parts have been removed from stock
PRODUCTION = 20 # BuildOrder is in production
CANCELLED = 30 # Build was cancelled
COMPLETE = 40 # Build is complete
options = {
PENDING: _("Pending"),
ALLOCATED: _("Allocated"),
PRODUCTION: _("Production"),
CANCELLED: _("Cancelled"),
COMPLETE: _("Complete"),
}
colors = {
PENDING: 'blue',
ALLOCATED: 'blue',
PRODUCTION: 'blue',
COMPLETE: 'green',
CANCELLED: 'red',
}
ACTIVE_CODES = [
PENDING,
ALLOCATED
PRODUCTION,
]

View File

@ -0,0 +1,19 @@
# Generated by Django 3.0.7 on 2020-10-20 10:09
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('build', '0022_auto_20201020_0953'),
]
operations = [
migrations.AlterField(
model_name='build',
name='status',
field=models.PositiveIntegerField(choices=[(10, 'Pending'), (20, 'Production'), (30, 'Cancelled'), (40, 'Complete')], default=10, help_text='Build status code', validators=[django.core.validators.MinValueValidator(0)], verbose_name='Build Status'),
),
]

View File

@ -440,6 +440,15 @@ class BuildCreate(AjaxCreateView):
'success': _('Created new build'),
}
def post_save(self, new_object):
"""
Called immediately after the build has been created.
"""
build = new_object
print("Created:", build)
class BuildUpdate(AjaxUpdateView):
""" View for editing a Build object """