mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 12:35:46 +00:00
Merge branch 'master' of https://github.com/inventree/InvenTree
# Conflicts: # InvenTree/customer/templates/customer/order_index.html
This commit is contained in:
@ -18,4 +18,5 @@ class BuildAdmin(admin.ModelAdmin):
|
||||
'notes',
|
||||
)
|
||||
|
||||
|
||||
admin.site.register(Build, BuildAdmin)
|
||||
|
@ -30,4 +30,4 @@ class EditBuildForm(forms.ModelForm):
|
||||
'quantity',
|
||||
'status',
|
||||
'completion_date',
|
||||
]
|
||||
]
|
||||
|
@ -8,6 +8,7 @@ from django.core.validators import MinValueValidator
|
||||
|
||||
from part.models import Part
|
||||
|
||||
|
||||
class Build(models.Model):
|
||||
""" A Build object organises the creation of new parts from the component parts
|
||||
It uses the part BOM to generate new parts.
|
||||
@ -19,26 +20,24 @@ class Build(models.Model):
|
||||
|
||||
# Build status codes
|
||||
PENDING = 10 # Build is pending / active
|
||||
HOLDING = 20 # Build is currently being held
|
||||
CANCELLED = 30 # Build was cancelled
|
||||
COMPLETE = 40 # Build is complete
|
||||
HOLDING = 20 # Build is currently being held
|
||||
CANCELLED = 30 # Build was cancelled
|
||||
COMPLETE = 40 # Build is complete
|
||||
|
||||
BUILD_STATUS_CODES = {
|
||||
PENDING : _("Pending"),
|
||||
HOLDING : _("Holding"),
|
||||
CANCELLED : _("Cancelled"),
|
||||
COMPLETE : _("Complete"),
|
||||
}
|
||||
BUILD_STATUS_CODES = {PENDING: _("Pending"),
|
||||
HOLDING: _("Holding"),
|
||||
CANCELLED: _("Cancelled"),
|
||||
COMPLETE: _("Complete"),
|
||||
}
|
||||
|
||||
batch = models.CharField(max_length=100, blank=True, null=True,
|
||||
help_text='Batch code for this build output')
|
||||
help_text='Batch code for this build output')
|
||||
|
||||
# Status of the build
|
||||
status = models.PositiveIntegerField(default=PENDING,
|
||||
choices=BUILD_STATUS_CODES.items(),
|
||||
validators=[MinValueValidator(0)])
|
||||
|
||||
|
||||
# Date the build model was 'created'
|
||||
creation_date = models.DateField(auto_now=True, editable=False)
|
||||
|
||||
|
@ -15,4 +15,4 @@ build_urls = [
|
||||
url(r'^(?P<pk>\d+)/', include(build_detail_urls)),
|
||||
|
||||
url(r'.*$', views.BuildIndex.as_view(), name='build-index'),
|
||||
]
|
||||
]
|
||||
|
@ -12,6 +12,7 @@ from .models import Build
|
||||
|
||||
from .forms import EditBuildForm
|
||||
|
||||
|
||||
class BuildIndex(ListView):
|
||||
model = Build
|
||||
template_name = 'build/index.html'
|
||||
|
Reference in New Issue
Block a user