mege
This commit is contained in:
@@ -21,6 +21,22 @@ class ProductExcelViewSet(viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
queryset = product_models.QuotaDistribution.objects.all()
|
||||
serializer_class = distribution_serializers.QuotaDistributionSerializer
|
||||
filter_backends = [filters.SearchFilter]
|
||||
search_fields = [
|
||||
"assigner_organization__name",
|
||||
"assigned_organization__name",
|
||||
"distribution_id",
|
||||
"quota__quota_id",
|
||||
"quota__product__name",
|
||||
"quota__sale_type",
|
||||
"quota__group",
|
||||
"registerer_organization__name",
|
||||
"quota_id",
|
||||
"product__name",
|
||||
"sale_type",
|
||||
"sale_unit__unit",
|
||||
"group"
|
||||
|
||||
]
|
||||
|
||||
# noqa # سهمیه و توزیع
|
||||
@action(
|
||||
@@ -191,7 +207,7 @@ class ProductExcelViewSet(viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
Q(is_time_unlimited=False) |
|
||||
Q(start_date_limit__lte=today, end_date_limit__gte=today)
|
||||
)
|
||||
user_relations = self.filter_query(incentive_plans)
|
||||
incentive_plans = self.filter_query(incentive_plans)
|
||||
ser_data = IncentivePlanSerializer(incentive_plans, many=True).data
|
||||
|
||||
excel_options = [
|
||||
@@ -271,15 +287,6 @@ class ProductExcelViewSet(viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
queryset = product_models.Quota.objects.filter(id=request.GET['id'], trash=False)
|
||||
queryset = self.filter_query(queryset)
|
||||
serializer_class = QuotaSerializer
|
||||
filter_backends = [filters.SearchFilter]
|
||||
search_fields = [
|
||||
"registerer_organization__name",
|
||||
"quota_id",
|
||||
"product__name",
|
||||
"sale_type",
|
||||
"sale_unit__unit",
|
||||
"group",
|
||||
]
|
||||
|
||||
output = BytesIO()
|
||||
workbook = Workbook()
|
||||
@@ -529,18 +536,7 @@ class ProductExcelViewSet(viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
def quota_excel(self, request):
|
||||
queryset = product_models.Quota.objects.all()
|
||||
queryset = self.filter_query(queryset)
|
||||
|
||||
serializer_class = QuotaSerializer
|
||||
filter_backends = [filters.SearchFilter]
|
||||
search_fields = [
|
||||
"registerer_organization__name",
|
||||
"quota_id",
|
||||
"product__name",
|
||||
"sale_type",
|
||||
"sale_unit__unit",
|
||||
"group",
|
||||
]
|
||||
|
||||
output = BytesIO()
|
||||
workbook = Workbook()
|
||||
worksheet = workbook.active
|
||||
|
||||
@@ -17,6 +17,15 @@ from common.helpers import get_organization_by_user
|
||||
class WareHouseExcelViewSet(viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
queryset = warehouse_models.InventoryEntry.objects.all()
|
||||
serializer_class = warehouse_serializers.InventoryEntrySerializer
|
||||
search_fields = [
|
||||
"distribution__distribution_id",
|
||||
"organization__name",
|
||||
"weight",
|
||||
"balance",
|
||||
"lading_number",
|
||||
"is_confirmed",
|
||||
]
|
||||
date_field = "create_date"
|
||||
|
||||
# noqa # ورودی به انبار
|
||||
@action(
|
||||
|
||||
Reference in New Issue
Block a user