mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix logic for completing builds
- Display better messages to the user, too
This commit is contained in:
@ -109,8 +109,6 @@ class BuildAutoAllocate(AjaxUpdateView):
|
||||
|
||||
build = self.get_object()
|
||||
|
||||
form = self.get_form()
|
||||
|
||||
context['allocations'] = build.getAutoAllocations()
|
||||
|
||||
context['build'] = build
|
||||
@ -398,8 +396,8 @@ class BuildComplete(AjaxUpdateView):
|
||||
|
||||
def validate(self, build, form, **kwargs):
|
||||
|
||||
if not build.can_complete:
|
||||
form.add_error(None, _('Build order cannot be completed'))
|
||||
if build.incomplete_count > 0:
|
||||
form.add_error(None, _('Build order cannot be completed - incomplete outputs remain'))
|
||||
|
||||
def save(self, build, form, **kwargs):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user