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

Add ability to specify "source location" for stock allocations

- Defaults to build.take_from
- User-selectable at run-time
- Selected value affects select2 query
This commit is contained in:
Oliver
2021-10-05 10:38:18 +11:00
parent 76668b0d54
commit 563deb5ffa
4 changed files with 94 additions and 14 deletions

View File

@ -821,7 +821,7 @@ class StockList(generics.ListCreateAPIView):
if loc_id is not None:
# Filter by 'null' location (i.e. top-level items)
if isNull(loc_id):
if isNull(loc_id) and not cascade:
queryset = queryset.filter(location=None)
else:
try: