From 427404b3bafaec50a17836c864be3f89baaef58c Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 11 Aug 2022 12:46:33 +1000 Subject: [PATCH] Allow builds to be completed without any outputs (#3518) * Remove form validation error if no build outputs are created * Remove check before launching build-complete form --- InvenTree/build/serializers.py | 3 --- InvenTree/build/templates/build/build_base.html | 12 ------------ 2 files changed, 15 deletions(-) diff --git a/InvenTree/build/serializers.py b/InvenTree/build/serializers.py index 309e63071e..6c8c49c5bf 100644 --- a/InvenTree/build/serializers.py +++ b/InvenTree/build/serializers.py @@ -546,9 +546,6 @@ class BuildCompleteSerializer(serializers.Serializer): if build.incomplete_count > 0: raise ValidationError(_("Build order has incomplete outputs")) - if not build.has_build_outputs(): - raise ValidationError(_("No build outputs have been created for this build order")) - return data def save(self): diff --git a/InvenTree/build/templates/build/build_base.html b/InvenTree/build/templates/build/build_base.html index 19dc2daeee..8c051d7f67 100644 --- a/InvenTree/build/templates/build/build_base.html +++ b/InvenTree/build/templates/build/build_base.html @@ -224,23 +224,11 @@ src="{% static 'img/blank_image.png' %}" }); $("#build-complete").on('click', function() { - - {% if build.incomplete_count > 0 %} - showAlertDialog( - '{% trans "Incomplete Outputs" %}', - '{% trans "Build Order cannot be completed as incomplete build outputs remain" %}', - { - alert_style: 'danger', - } - ); - {% 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 %}, }); - {% endif %} }); {% if report_enabled %}