mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Optionally show/hide the "accept_overallocated" dialog option (#3290)
This commit is contained in:
parent
fd03b4068d
commit
5045f85346
@ -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
|
||||
|
@ -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 %},
|
||||
});
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user