mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
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
This commit is contained in:
parent
1010a6296f
commit
427404b3ba
@ -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):
|
||||
|
@ -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 %}
|
||||
|
Loading…
Reference in New Issue
Block a user