import - quota_sale_unit to trans sale items
This commit is contained in:
@@ -112,7 +112,7 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
|
||||
|
||||
return attrs
|
||||
|
||||
def to_representation(self, instance):
|
||||
def to_representation(self, instance: warehouse_models.InventoryQuotaSaleTransaction):
|
||||
""" custom output of inventory sale transaction serializer """
|
||||
|
||||
representation = super().to_representation(instance)
|
||||
@@ -140,3 +140,11 @@ class InventoryQuotaSaleItemSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = warehouse_models.InventoryQuotaSaleItem
|
||||
fields = '__all__'
|
||||
|
||||
def to_representation(self, instance):
|
||||
representation = super().to_representation(instance)
|
||||
|
||||
if instance.quota_stat:
|
||||
representation['quota_sale_unit'] = instance.quota_stat.quota.sale_unit.unit
|
||||
|
||||
return representation
|
||||
|
||||
Reference in New Issue
Block a user