mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add ability to filter BOM API by "trackable" status of the sub_part object
This commit is contained in:
parent
d81aa5c051
commit
b27f926310
@ -777,6 +777,13 @@ class BomList(generics.ListCreateAPIView):
|
||||
if sub_part is not None:
|
||||
queryset = queryset.filter(sub_part=sub_part)
|
||||
|
||||
# Filter by "trackable" status of the sub-part
|
||||
trackable = self.request.query_params.get('trackable', None)
|
||||
|
||||
if trackable is not None:
|
||||
trackable = str2bool(trackable)
|
||||
queryset = queryset.filter(sub_part__trackable=trackable)
|
||||
|
||||
return queryset
|
||||
|
||||
permission_classes = [
|
||||
|
Loading…
Reference in New Issue
Block a user