import - quota_sale_unit to trans sale items
This commit is contained in:
@@ -112,7 +112,7 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
return attrs
|
return attrs
|
||||||
|
|
||||||
def to_representation(self, instance):
|
def to_representation(self, instance: warehouse_models.InventoryQuotaSaleTransaction):
|
||||||
""" custom output of inventory sale transaction serializer """
|
""" custom output of inventory sale transaction serializer """
|
||||||
|
|
||||||
representation = super().to_representation(instance)
|
representation = super().to_representation(instance)
|
||||||
@@ -140,3 +140,11 @@ class InventoryQuotaSaleItemSerializer(serializers.ModelSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = warehouse_models.InventoryQuotaSaleItem
|
model = warehouse_models.InventoryQuotaSaleItem
|
||||||
fields = '__all__'
|
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