2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Display list of build outputs in the Build tab

- Allow StockList api to be filtered by Build id
This commit is contained in:
Oliver Walters
2020-02-17 23:31:23 +11:00
parent e483b42df6
commit 23aebab6d0
6 changed files with 53 additions and 2 deletions

View File

@ -260,6 +260,8 @@ class StockList(generics.ListCreateAPIView):
- ancestor: Filter by an 'ancestor' StockItem
"""
queryset = StockItem.objects.all()
def get_serializer(self, *args, **kwargs):
try:
@ -334,7 +336,9 @@ class StockList(generics.ListCreateAPIView):
"""
# Start with all objects
stock_list = StockItem.objects.filter(customer=None, belongs_to=None)
stock_list = super(StockList, self).get_queryset()
stock_list = stock_list.filter(customer=None, belongs_to=None)
# Does the client wish to filter by the Part ID?
part_id = self.request.query_params.get('part', None)
@ -426,6 +430,7 @@ class StockList(generics.ListCreateAPIView):
'supplier_part',
'customer',
'belongs_to',
'build',
# 'status' TODO - There are some issues filtering based on an enumeration field
]