fix bug of keys in transaction when they not in body data
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from django.urls import path, include
|
||||
|
||||
urlpatterns = [
|
||||
path('web/', include('apps.notification.web.api.v1.urls')),
|
||||
path('pos/', include('apps.notification.pos.api.v1.urls'))
|
||||
# path('web/', include('apps.notification.web.api.v1.urls')),
|
||||
# path('pos/', include('apps.notification.pos.api.v1.urls'))
|
||||
]
|
||||
|
||||
@@ -145,8 +145,8 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
|
||||
for item_data in items_data:
|
||||
warehouse_models.InventoryQuotaSaleItem.objects.filter(
|
||||
Q(transaction=transaction) & (
|
||||
Q(free_product_id=item_data['free_product']) |
|
||||
Q(gov_product_id=item_data['gov_product'])
|
||||
Q(free_product_id=item_data.get('free_product', None)) |
|
||||
Q(gov_product_id=item_data.get('gov_product', None))
|
||||
)
|
||||
).update(**item_data)
|
||||
return transaction
|
||||
@@ -180,8 +180,8 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
|
||||
for item_data in items_data:
|
||||
warehouse_models.InventoryQuotaSaleItem.objects.filter(
|
||||
Q(transaction=transaction) & (
|
||||
Q(free_product_id=item_data['free_product']) |
|
||||
Q(gov_product_id=item_data['gov_product'])
|
||||
Q(free_product_id=item_data.get('free_product', None)) |
|
||||
Q(gov_product_id=item_data.get('gov_product', None))
|
||||
)
|
||||
).update(**item_data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user