diff --git a/InvenTree/build/models.py b/InvenTree/build/models.py index f05fbe74cf..c15f28ba1d 100644 --- a/InvenTree/build/models.py +++ b/InvenTree/build/models.py @@ -1018,7 +1018,7 @@ class Build(MPTTModel, ReferenceIndexingMixin): """Returns True if the un-tracked parts are fully allocated for this BuildOrder.""" return self.is_fully_allocated(None) - def has_overallocated_parts(self, output): + def has_overallocated_parts(self, output=None): """Check if parts have been 'over-allocated' against the specified output. Note: If output=None, test un-tracked parts diff --git a/InvenTree/build/templates/build/build_base.html b/InvenTree/build/templates/build/build_base.html index 45263e8a35..19dc2daeee 100644 --- a/InvenTree/build/templates/build/build_base.html +++ b/InvenTree/build/templates/build/build_base.html @@ -236,6 +236,7 @@ src="{% static 'img/blank_image.png' %}" {% else %} completeBuildOrder({{ build.pk }}, { + overallocated: {% if build.has_overallocated_parts %}true{% else %}false{% endif %}, allocated: {% if build.are_untracked_parts_allocated %}true{% else %}false{% endif %}, completed: {% if build.remaining == 0 %}true{% else %}false{% endif %}, }); diff --git a/InvenTree/templates/js/translated/build.js b/InvenTree/templates/js/translated/build.js index fb1ca9c3ef..2a4e0a6edb 100644 --- a/InvenTree/templates/js/translated/build.js +++ b/InvenTree/templates/js/translated/build.js @@ -211,6 +211,10 @@ function completeBuildOrder(build_id, options={}) { delete fields.accept_incomplete; } + if (!options.overallocated) { + delete fields.accept_overallocated; + } + constructForm(url, { fields: fields, reload: true,