diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py index 3c848620d5..368dee2f1a 100644 --- a/InvenTree/part/api.py +++ b/InvenTree/part/api.py @@ -810,6 +810,14 @@ class BomList(generics.ListCreateAPIView): queryset = queryset.filter(optional=optional) + # Filter by "inherited" status + inherited = params.get('inherited', None) + + if inherited is not None: + inherited = str2bool(inherited) + + queryset = queryset.filter(inherited=inherited) + # Filter by part? part = params.get('part', None) diff --git a/InvenTree/part/serializers.py b/InvenTree/part/serializers.py index 05fc3091f7..103d0202f1 100644 --- a/InvenTree/part/serializers.py +++ b/InvenTree/part/serializers.py @@ -381,17 +381,18 @@ class BomItemSerializer(InvenTreeModelSerializer): class Meta: model = BomItem fields = [ + 'inherited', + 'note', + 'optional', + 'overage', 'pk', 'part', 'part_detail', - 'sub_part', - 'sub_part_detail', 'quantity', 'reference', + 'sub_part', + 'sub_part_detail', # 'price_range', - 'optional', - 'overage', - 'note', 'validated', ]