diff --git a/InvenTree/build/models.py b/InvenTree/build/models.py index 79bedd5616..0e0068fdaf 100644 --- a/InvenTree/build/models.py +++ b/InvenTree/build/models.py @@ -133,6 +133,9 @@ class Build(models.Model): for item in self.allocated_stock.all(): item.delete() + # Date of 'completion' is the date the build was cancelled + self.completion_date = datetime.now().date() + self.status = self.CANCELLED self.save() diff --git a/InvenTree/build/templates/build/build_list.html b/InvenTree/build/templates/build/build_list.html index 5720235911..890dd551b1 100644 --- a/InvenTree/build/templates/build/build_list.html +++ b/InvenTree/build/templates/build/build_list.html @@ -1,4 +1,20 @@ +{% extends "collapse.html" %} +{% block collapse_title %} +{{ title }} - {{ builds | length }} +{% endblock %} + +{% block collapse_content %} +
Build | +Part | +Quantity | +Status | +
---|---|---|---|
{{ build.title }} | @@ -6,4 +22,7 @@{{ build.quantity }} | {% include "build_status.html" with build=build %} |