2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-09 07:00:56 +00:00

"Fixes" for completing a build

- This will require a lot of unit testing to get right
This commit is contained in:
Oliver Walters
2020-04-26 00:32:09 +10:00
parent 72c43d0c2d
commit 0892b160c6
6 changed files with 85 additions and 29 deletions

View File

@ -314,7 +314,6 @@ class StockList(generics.ListCreateAPIView):
- POST: Create a new StockItem
Additional query parameters are available:
- aggregate: If 'true' then stock items are aggregated by Part and Location
- location: Filter stock by location
- category: Filter by parts belonging to a certain category
- supplier: Filter by supplier
@ -370,10 +369,10 @@ class StockList(generics.ListCreateAPIView):
if in_stock:
# Filter out parts which are not actually "in stock"
stock_list = stock_list.filter(customer=None, belongs_to=None)
stock_list = stock_list.filter(customer=None, belongs_to=None, build_order=None)
else:
# Only show parts which are not in stock
stock_list = stock_list.exclude(customer=None, belongs_to=None)
stock_list = stock_list.exclude(customer=None, belongs_to=None, build_order=None)
# Filter by 'allocated' patrs?
allocated = self.request.query_params.get('allocated', None)
@ -516,6 +515,7 @@ class StockList(generics.ListCreateAPIView):
'belongs_to',
'build',
'sales_order',
'build_order',
]