fix bug ofdistrivution key in transaction

This commit is contained in:
2025-09-28 12:15:23 +03:30
parent fe93a22be1
commit ee282482d1

View File

@@ -151,7 +151,10 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
# get product by type
gov_product = item_data.pop('gov_product') if 'gov_product' in item_data.keys() else None
free_product = item_data.pop('free_product') if 'free_product' in item_data.keys() else None
distribution = QuotaDistribution.objects.get(id=item_data.pop('quota_distribution'))
distribution = QuotaDistribution.objects.get(
id=item_data.pop('quota_distribution')
) if 'quota_distribution' in item_data.keys() else None
# create item for transaction
item = warehouse_models.InventoryQuotaSaleItem.objects.create(