mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add ability to filter by whether the part is serialized or not
This commit is contained in:
parent
4615fbc0d8
commit
0851a925fb
@ -479,6 +479,17 @@ 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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user