2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-11 07:24:15 +00:00

Add API LIST endpoint for SalesOrderAllocations

This commit is contained in:
Oliver Walters
2021-02-17 23:56:47 +11:00
committed by Oliver
parent 43478a0be7
commit ad8dbb5900
3 changed files with 82 additions and 22 deletions

View File

@ -236,11 +236,12 @@ class SalesOrderAllocationSerializer(InvenTreeModelSerializer):
This includes some fields from the related model objects.
"""
location_path = serializers.CharField(source='get_location_path')
location_id = serializers.IntegerField(source='get_location')
serial = serializers.CharField(source='get_serial')
po = serializers.CharField(source='get_po')
quantity = serializers.FloatField()
location_path = serializers.CharField(source='get_location_path', read_only=True)
location = serializers.IntegerField(source='get_location', read_only=True)
part = serializers.PrimaryKeyRelatedField(source='item.part', read_only=True)
order = serializers.PrimaryKeyRelatedField(source='line.order', many=False, read_only=True)
serial = serializers.CharField(source='get_serial', read_only=True)
quantity = serializers.FloatField(read_only=True)
class Meta:
model = SalesOrderAllocation
@ -250,9 +251,10 @@ class SalesOrderAllocationSerializer(InvenTreeModelSerializer):
'line',
'serial',
'quantity',
'location_id',
'order',
'part',
'location',
'location_path',
'po',
'item',
]