2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 20:45:44 +00:00

Updates for stock allocation form

- Data submission
- Nested error handling
- Button callbacks to remove rows
This commit is contained in:
Oliver
2021-10-04 23:20:03 +11:00
parent a9d5b776d3
commit 074466f087
2 changed files with 142 additions and 75 deletions

View File

@ -154,6 +154,13 @@ class BuildAllocationItemSerializer(serializers.Serializer):
required=True
)
def validate_quantity(self, quantity):
if quantity <= 0:
raise ValidationError(_("Quantity must be greater than zero"))
return quantity
output = serializers.PrimaryKeyRelatedField(
queryset=StockItem.objects.filter(is_building=True),
many=False,