fix bug ofdistrivution key in transaction
This commit is contained in:
@@ -151,7 +151,10 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
|
|||||||
# get product by type
|
# get product by type
|
||||||
gov_product = item_data.pop('gov_product') if 'gov_product' in item_data.keys() else None
|
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
|
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
|
# create item for transaction
|
||||||
item = warehouse_models.InventoryQuotaSaleItem.objects.create(
|
item = warehouse_models.InventoryQuotaSaleItem.objects.create(
|
||||||
|
|||||||
Reference in New Issue
Block a user