From 1f254464aa9bc95614884af9bf5a41f925d1245b Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Fri, 31 Oct 2025 17:44:31 +0500 Subject: [PATCH] fix --- core/apps/wherehouse/views/inventory.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/apps/wherehouse/views/inventory.py b/core/apps/wherehouse/views/inventory.py index 3c4bf62..37af8cc 100644 --- a/core/apps/wherehouse/views/inventory.py +++ b/core/apps/wherehouse/views/inventory.py @@ -34,10 +34,11 @@ class InventoryListApiView(generics.GenericAPIView): inventories = inventories.filter(project_folder__in=project_folder_ids) if project_ids: inventories = inventories.filter(project__in=project_ids) - if product_exists.lower() == 'true': - inventories = inventories.exclude(quantity__lte=0) - elif product_exists.lower() == 'false': - inventories = inventories.filter(quantity__lte=0) + if product_exists: + if product_exists.lower() == 'true': + inventories = inventories.exclude(quantity__lte=0) + elif product_exists.lower() == 'false': + inventories = inventories.filter(quantity__lte=0) if start_date and end_date: inventories = inventories.filter(created_at__range=(start_date, end_date)) page = self.paginate_queryset(inventories)