mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-30 18:50:53 +00:00
Adds ability to filter stock API results by batch code
This commit is contained in:
@ -455,6 +455,12 @@ class StockList(generics.ListCreateAPIView):
|
||||
if belongs_to:
|
||||
queryset = queryset.filter(belongs_to=belongs_to)
|
||||
|
||||
# Filter by batch code
|
||||
batch = params.get('batch', None)
|
||||
|
||||
if batch is not None:
|
||||
queryset = queryset.filter(batch=batch)
|
||||
|
||||
build = params.get('build', None)
|
||||
|
||||
if build:
|
||||
|
Reference in New Issue
Block a user