diff --git a/core/apps/wherehouse/views/inventory.py b/core/apps/wherehouse/views/inventory.py index 51dba94..3c4bf62 100644 --- a/core/apps/wherehouse/views/inventory.py +++ b/core/apps/wherehouse/views/inventory.py @@ -34,10 +34,10 @@ 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 == 'true': - inventories = inventories.exclude(quantity=0) - elif product_exists == 'false': - inventories = inventories.filter(quantity=0) + 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)