From 408c6a40406fa9d57c6bf84acb6ef0f660166b41 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 5 Jun 2020 09:05:57 +1000 Subject: [PATCH] Filter stock list by "customer" --- InvenTree/stock/api.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index 23d836b1e1..018b588c1f 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -471,6 +471,12 @@ class StockList(generics.ListCreateAPIView): if sales_order: queryset = queryset.filter(sales_order=sales_order) + # Filter by customer + customer = params.get('customer', None) + + if customer: + queryset = queryset.filter(customer=customer) + # Filter by "serialized" status? serialized = params.get('serialized', None)