mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +00:00
Implement pagination for stock history tracking API (#4631)
* Bump version number to 0.11.1 * Implement pagination for stock history tracking API (cherry picked from commit 75696770c616033686a4db33c67630e3a19f2863)
This commit is contained in:
parent
78badcd65b
commit
fdaf6d3e19
@ -1188,6 +1188,11 @@ class StockTrackingList(ListAPI):
|
||||
"""List all stock tracking entries."""
|
||||
queryset = self.filter_queryset(self.get_queryset())
|
||||
|
||||
page = self.paginate_queryset(queryset)
|
||||
|
||||
if page is not None:
|
||||
serializer = self.get_serializer(page, many=True)
|
||||
else:
|
||||
serializer = self.get_serializer(queryset, many=True)
|
||||
|
||||
data = serializer.data
|
||||
@ -1262,6 +1267,8 @@ class StockTrackingList(ListAPI):
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if page is not None:
|
||||
return self.get_paginated_response(data)
|
||||
if request.is_ajax():
|
||||
return JsonResponse(data, safe=False)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user