2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-23 02:50:18 +00:00

Improvements for build output completion

- Check if the output is fully allocated (throw error if not)
- Reload tables after actions performed
This commit is contained in:
Oliver
2021-10-17 21:37:10 +11:00
parent bd7fef720d
commit 542b4113a1
4 changed files with 46 additions and 7 deletions
InvenTree
build
templates
js

@@ -152,6 +152,10 @@ class BuildOutputSerializer(serializers.Serializer):
if not output.is_building:
raise ValidationError(_("This build output has already been completed"))
# The build output must have all tracked parts allocated
if not build.isFullyAllocated(output):
raise ValidationError(_("This build output is not fully allocated"))
return output
class Meta:

@@ -364,7 +364,11 @@ inventreeGet(
outputs,
{
success: function() {
// Reload the "in progress" table
$('#build-output-table').bootstrapTable('refresh');
// Reload the "completed" table
$('#build-stock-table').bootstrapTable('refresh');
}
}
);