diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index f72f2590cc..a56d4081d0 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -478,6 +478,23 @@ class StockList(generics.ListCreateAPIView): if sales_order: queryset = queryset.filter(sales_order=sales_order) + + # Filter by "serialized" status? + serialized = params.get('serialized', None) + + if serialized is not None: + serialized = str2bool(serialized) + + if serialized: + queryset = queryset.exclude(serial=None) + else: + queryset = queryset.filter(serial=None) + + # Filter by serial number? + serial_number = params.get('serial', None) + + if serial_number is not None: + queryset = queryset.filter(serial=serial_number) in_stock = self.request.query_params.get('in_stock', None)