From 3336eb9f45ad20e4247a36d2b4323c4b1000a3d6 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 9 Aug 2020 21:12:49 +1000 Subject: [PATCH] Default stock list behaviour is to only show in_stock items --- InvenTree/stock/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index b291a2cb5c..a10262ce9c 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -518,7 +518,8 @@ class StockList(generics.ListCreateAPIView): if serial_number_lte is not None: queryset = queryset.filter(serial__lte=serial_number_lte) - in_stock = params.get('in_stock', None) + # Filter by "in_stock" status (default behaviour is "True") + in_stock = params.get('in_stock', True) if in_stock is not None: in_stock = str2bool(in_stock)