update excel

This commit is contained in:
7nimor
2025-07-31 16:28:22 +03:30
parent e0f55076c7
commit 4c8f494e2e

View File

@@ -5,7 +5,6 @@ from openpyxl import Workbook
from openpyxl.styles import Font
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.permissions import AllowAny
from apps.warehouse import models as warehouse_models
from apps.warehouse.web.api.v1 import serializers as warehouse_serializers
@@ -17,7 +16,7 @@ from common.helpers import get_organization_by_user
class WareHouseExcelViewSet(viewsets.ModelViewSet):
queryset = warehouse_models.InventoryEntry.objects.all()
serializer_class = warehouse_serializers.InventoryEntrySerializer
permission_classes = [AllowAny]
# noqa # ورودی به انبار
@action(
methods=['get'],
@@ -33,7 +32,7 @@ class WareHouseExcelViewSet(viewsets.ModelViewSet):
worksheet.sheet_view.rightToLeft = True
worksheet.insert_rows(1)
entries = self.queryset.all()
entries = self.queryset.filter(organization=get_organization_by_user(request.user))
ser_data = self.serializer_class(entries, many=True).data
excel_options = [