diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index c5a8cb838c..54690223d6 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -444,7 +444,8 @@ class StockFilter(rest_filters.FilterSet): """ if str2bool(value): # The 'quantity' field is greater than the calculated 'allocated' field - return queryset.filter(Q(quantity__gt=F('allocated'))) + # Note that the item must also be "in stock" + return queryset.filter(StockItem.IN_STOCK_FILTER).filter(Q(quantity__gt=F('allocated'))) else: # The 'quantity' field is less than (or equal to) the calculated 'allocated' field return queryset.filter(Q(quantity__lte=F('allocated')))