mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge remote-tracking branch 'inventree/master'
This commit is contained in:
commit
dc9f7a7e82
@ -122,13 +122,9 @@ class StockItemLabelMixin:
|
||||
|
||||
params = self.request.query_params
|
||||
|
||||
if 'items[]' in params:
|
||||
items = params.getlist('items[]', [])
|
||||
elif 'item' in params:
|
||||
items = [params.get('item', None)]
|
||||
|
||||
if type(items) not in [list, tuple]:
|
||||
items = [items]
|
||||
for key in ['item', 'item[]', 'items', 'items[]']:
|
||||
if key in params:
|
||||
items = params.getlist(key, [])
|
||||
|
||||
valid_ids = []
|
||||
|
||||
@ -258,13 +254,10 @@ class StockLocationLabelMixin:
|
||||
|
||||
params = self.request.query_params
|
||||
|
||||
if 'locations[]' in params:
|
||||
locations = params.getlist('locations[]', [])
|
||||
elif 'location' in params:
|
||||
locations = [params.get('location', None)]
|
||||
for key in ['location', 'location[]', 'locations', 'locations[]']:
|
||||
|
||||
if type(locations) not in [list, tuple]:
|
||||
locations = [locations]
|
||||
if key in params:
|
||||
locations = params.getlist(key, [])
|
||||
|
||||
valid_ids = []
|
||||
|
||||
|
@ -62,7 +62,10 @@ class StockItemReportMixin:
|
||||
|
||||
params = self.request.query_params
|
||||
|
||||
items = params.getlist('item', [])
|
||||
for key in ['item', 'item[]', 'items', 'items[]']:
|
||||
if key in params:
|
||||
items = params.getlist(key, [])
|
||||
break
|
||||
|
||||
valid_ids = []
|
||||
|
||||
@ -92,7 +95,12 @@ class BuildReportMixin:
|
||||
|
||||
params = self.request.query_params
|
||||
|
||||
builds = params.getlist('build', [])
|
||||
for key in ['build', 'build[]', 'builds', 'builds[]']:
|
||||
|
||||
if key in params:
|
||||
builds = params.getlist(key, [])
|
||||
|
||||
break
|
||||
|
||||
valid_ids = []
|
||||
|
||||
@ -119,7 +127,10 @@ class PartReportMixin:
|
||||
|
||||
params = self.request.query_params
|
||||
|
||||
parts = params.getlist('part', [])
|
||||
for key in ['part', 'part[]', 'parts', 'parts[]']:
|
||||
|
||||
if key in params:
|
||||
parts = params.getlist(key, [])
|
||||
|
||||
valid_ids = []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user