fix pos my entries bug
This commit is contained in:
@@ -39,6 +39,7 @@ class InventoryEntryViewSet(viewsets.ModelViewSet, DynamicSearchMixin, POSDevice
|
|||||||
""" list of pos inventory entries """
|
""" list of pos inventory entries """
|
||||||
|
|
||||||
organization = self.get_device_organization()
|
organization = self.get_device_organization()
|
||||||
|
device = self.get_pos_device()
|
||||||
|
|
||||||
entries = self.queryset.filter(organization=organization)
|
entries = self.queryset.filter(organization=organization)
|
||||||
queryset = self.filter_query(entries) # return by search param or all objects
|
queryset = self.filter_query(entries) # return by search param or all objects
|
||||||
@@ -46,7 +47,7 @@ class InventoryEntryViewSet(viewsets.ModelViewSet, DynamicSearchMixin, POSDevice
|
|||||||
# paginate & response
|
# paginate & response
|
||||||
page = self.paginate_queryset(queryset)
|
page = self.paginate_queryset(queryset)
|
||||||
if page is not None:
|
if page is not None:
|
||||||
serializer = self.get_serializer(page, many=True)
|
serializer = self.get_serializer(page, many=True, context={'device': device})
|
||||||
return self.get_paginated_response(serializer.data)
|
return self.get_paginated_response(serializer.data)
|
||||||
|
|
||||||
@action(
|
@action(
|
||||||
|
|||||||
Reference in New Issue
Block a user