mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-19 18:05:54 +00:00
Assign multiple stock items to a customer at one
This commit is contained in:
@@ -568,6 +568,10 @@ class StockAssignmentItemSerializer(serializers.Serializer):
|
||||
if not item.in_stock:
|
||||
raise ValidationError(_("Item must be in stock"))
|
||||
|
||||
# The base part must be "salable"
|
||||
if not item.part.salable:
|
||||
raise ValidationError(_("Part must be salable"))
|
||||
|
||||
# The item must not be allocated to a sales order
|
||||
if item.sales_order_allocations.count() > 0:
|
||||
raise ValidationError(_("Item is allocated to a sales order"))
|
||||
@@ -655,6 +659,7 @@ class StockAssignmentSerializer(serializers.Serializer):
|
||||
notes=notes,
|
||||
)
|
||||
|
||||
|
||||
class StockAdjustmentItemSerializer(serializers.Serializer):
|
||||
"""
|
||||
Serializer for a single StockItem within a stock adjument request.
|
||||
|
Reference in New Issue
Block a user