2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

Default stock list behaviour is to only show in_stock items

This commit is contained in:
Oliver Walters 2020-08-09 21:12:49 +10:00
parent 0da9e0f834
commit 3336eb9f45

View File

@ -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)