mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 03:56:43 +00:00
Adds ability to filter build items by "tracked" flag
This commit is contained in:
parent
e6c95bf6b2
commit
0841c628e0
@ -442,6 +442,18 @@ class BuildItemList(generics.ListCreateAPIView):
|
|||||||
if part_pk:
|
if part_pk:
|
||||||
queryset = queryset.filter(stock_item__part=part_pk)
|
queryset = queryset.filter(stock_item__part=part_pk)
|
||||||
|
|
||||||
|
# Filter by "tracked" status
|
||||||
|
# Tracked means that the item is "installed" into a build output (stock item)
|
||||||
|
tracked = params.get('tracked', None)
|
||||||
|
|
||||||
|
if tracked is not None:
|
||||||
|
tracked = str2bool(tracked)
|
||||||
|
|
||||||
|
if tracked:
|
||||||
|
queryset = queryset.exclude(install_into=None)
|
||||||
|
else:
|
||||||
|
queryset = queryest.filter(install_into=None)
|
||||||
|
|
||||||
# Filter by output target
|
# Filter by output target
|
||||||
output = params.get('output', None)
|
output = params.get('output', None)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user