From 6ebe67bd52be97202c86e6d40ad22d221381b09f Mon Sep 17 00:00:00 2001 From: 7nimor Date: Sun, 3 Aug 2025 08:37:48 +0330 Subject: [PATCH] update search for excel --- apps/product/services/excel/excel_processing.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/product/services/excel/excel_processing.py b/apps/product/services/excel/excel_processing.py index a7f16f7..4c71d14 100644 --- a/apps/product/services/excel/excel_processing.py +++ b/apps/product/services/excel/excel_processing.py @@ -278,7 +278,6 @@ class ProductExcelViewSet(viewsets.ModelViewSet, ExcelDynamicSearchMixin): ) def detail_quota_excel(self, request): queryset = product_models.Quota.objects.filter(id=request.GET['id'], trash=False) - queryset = self.filter_query(queryset) serializer_class = QuotaSerializer search_fields_detail_quota = [ "registerer_organization__name", @@ -288,6 +287,7 @@ class ProductExcelViewSet(viewsets.ModelViewSet, ExcelDynamicSearchMixin): "sale_unit__unit", "group", ] + queryset = self.filter_query(queryset, search_list=search_fields_detail_quota) output = BytesIO() workbook = Workbook() @@ -296,7 +296,6 @@ class ProductExcelViewSet(viewsets.ModelViewSet, ExcelDynamicSearchMixin): worksheet.insert_rows(1) active = request.GET.get('active') - queryset = self.filter_query(queryset, search_list=search_fields_detail_quota) # return by search param or all objects organization = get_organization_by_user(request.user) queryset = queryset.filter( @@ -553,7 +552,6 @@ class ProductExcelViewSet(viewsets.ModelViewSet, ExcelDynamicSearchMixin): worksheet.insert_rows(1) active = request.GET.get('active') - queryset = self.filter_query(queryset, search_list=search_fields_quota) # return by search param or all objects organization = get_organization_by_user(request.user) @@ -571,6 +569,7 @@ class ProductExcelViewSet(viewsets.ModelViewSet, ExcelDynamicSearchMixin): ).order_by('-modify_date') quta_type = 'بایگانی' + queryset = self.filter_query(queryset, search_list=search_fields_quota) # return by search param or all objects ser_data = serializer_class(queryset, many=True).data excel_options = [