fix - dashboard quota filter by date
This commit is contained in:
@@ -24,6 +24,8 @@ class InventoryEntryViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewSet,
|
||||
search_fields = [
|
||||
"distribution__distribution_id",
|
||||
"organization__name",
|
||||
"org_quota_stat__quota__product__name",
|
||||
"delivery_address",
|
||||
"weight",
|
||||
"balance",
|
||||
"lading_number",
|
||||
@@ -128,7 +130,7 @@ class InventoryEntryViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewSet,
|
||||
organization=org,
|
||||
quota_id=pk
|
||||
)
|
||||
queryset = self.filter_query(entries) # return by search param or all objects
|
||||
queryset = self.filter_query(self.filter_queryset(entries)) # return by search param or all objects
|
||||
|
||||
# paginate & response
|
||||
page = self.paginate_queryset(queryset)
|
||||
@@ -150,7 +152,7 @@ class InventoryEntryViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewSet,
|
||||
entries = self.get_queryset(
|
||||
visibility_by_org_scope=True
|
||||
) if org.free_visibility_by_scope else self.get_queryset().filter(organization=org)
|
||||
queryset = self.filter_query(entries) # return by search param or all objects
|
||||
queryset = self.filter_query(self.filter_queryset(entries)) # return by search param or all objects
|
||||
|
||||
# paginate & response
|
||||
page = self.paginate_queryset(queryset)
|
||||
|
||||
Reference in New Issue
Block a user