transaction serializer
This commit is contained in:
@@ -95,6 +95,17 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
|
||||
|
||||
return attrs
|
||||
|
||||
def to_representation(self, instance):
|
||||
""" custom output of inventory sale transaction serializer """
|
||||
|
||||
representation = super().to_representation(instance)
|
||||
representation['items'] = InventoryQuotaSaleItemSerializer(
|
||||
instance.items.all(),
|
||||
many=True
|
||||
).data
|
||||
|
||||
return representation
|
||||
|
||||
|
||||
class InventoryQuotaSaleItemSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user