diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py index d643b8671a..60c391c1e1 100644 --- a/InvenTree/part/api.py +++ b/InvenTree/part/api.py @@ -761,12 +761,26 @@ 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 = params.get('trackable', None) + # Filter by "active" status of the part + part_active = params.get('part_active', None) - if trackable is not None: - trackable = str2bool(trackable) - queryset = queryset.filter(sub_part__trackable=trackable) + if part_active is not None: + part_active = str2bool(part_active) + queryset = queryset.filter(part__active=part_active) + + # Filter by "trackable" status of the part + part_trackable = params.get('part_trackable', None) + + if part_trackable is not None: + part_trackable = str2bool(part_trackable) + queryset = queryset.filter(part__trackable=part_trackable) + + # Filter by "trackable" status of the sub-part + sub_part_trackable = params.get('sub_part_trackable', None) + + if sub_part_trackable is not None: + sub_part_trackable = str2bool(sub_part_trackable) + queryset = queryset.filter(sub_part__trackable=sub_part_trackable) return queryset diff --git a/InvenTree/part/templates/part/bom.html b/InvenTree/part/templates/part/bom.html index c996edc2db..7b687f9aa0 100644 --- a/InvenTree/part/templates/part/bom.html +++ b/InvenTree/part/templates/part/bom.html @@ -32,21 +32,34 @@ {% endif %} -