fix - update transaction bug in items
This commit is contained in:
@@ -137,10 +137,9 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
|
||||
if transaction.transaction_status == 'success':
|
||||
for item_data in items_data:
|
||||
qs = warehouse_models.InventoryQuotaSaleItem.objects.filter(
|
||||
Q(transaction=transaction) & (
|
||||
Q(free_product_id=item_data.get('free_product', None)) |
|
||||
Q(gov_product_id=item_data.get('gov_product', None))
|
||||
)
|
||||
Q(free_product_id=item_data.get('free_product', None)),
|
||||
Q(gov_product_id=item_data.get('gov_product', None)),
|
||||
transaction=transaction,
|
||||
).update(**item_data)
|
||||
return transaction
|
||||
|
||||
@@ -172,10 +171,9 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
|
||||
# items can change
|
||||
for item_data in items_data:
|
||||
items = warehouse_models.InventoryQuotaSaleItem.objects.filter(
|
||||
Q(transaction=transaction) & (
|
||||
Q(free_product_id=item_data.get('free_product', None)) |
|
||||
Q(gov_product_id=item_data.get('gov_product', None))
|
||||
)
|
||||
Q(free_product_id=item_data.get('free_product', None)),
|
||||
Q(gov_product_id=item_data.get('gov_product', None)),
|
||||
transaction=transaction,
|
||||
)
|
||||
items.update(**item_data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user