mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add 'inherited' flag to API
This commit is contained in:
parent
d692c18274
commit
40d75090a7
@ -810,6 +810,14 @@ class BomList(generics.ListCreateAPIView):
|
|||||||
|
|
||||||
queryset = queryset.filter(optional=optional)
|
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?
|
# Filter by part?
|
||||||
part = params.get('part', None)
|
part = params.get('part', None)
|
||||||
|
|
||||||
|
@ -381,17 +381,18 @@ class BomItemSerializer(InvenTreeModelSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = BomItem
|
model = BomItem
|
||||||
fields = [
|
fields = [
|
||||||
|
'inherited',
|
||||||
|
'note',
|
||||||
|
'optional',
|
||||||
|
'overage',
|
||||||
'pk',
|
'pk',
|
||||||
'part',
|
'part',
|
||||||
'part_detail',
|
'part_detail',
|
||||||
'sub_part',
|
|
||||||
'sub_part_detail',
|
|
||||||
'quantity',
|
'quantity',
|
||||||
'reference',
|
'reference',
|
||||||
|
'sub_part',
|
||||||
|
'sub_part_detail',
|
||||||
# 'price_range',
|
# 'price_range',
|
||||||
'optional',
|
|
||||||
'overage',
|
|
||||||
'note',
|
|
||||||
'validated',
|
'validated',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user