update excel warehouse
This commit is contained in:
@@ -43,13 +43,13 @@ class ProductExcelViewSet(viewsets.ModelViewSet):
|
||||
product = product.filter(
|
||||
Q(assigned_organization=organization)
|
||||
).order_by('-modify_date')
|
||||
description_name = 'سهمیه'
|
||||
description_name = 'سهمیه' # noqa
|
||||
|
||||
elif query.get('param') == 'assigner':
|
||||
product = product.filter(
|
||||
Q(assigner_organization=organization)
|
||||
).order_by('-modify_date')
|
||||
description_name = 'توزیع'
|
||||
description_name = 'توزیع' # noqa
|
||||
|
||||
elif query.get('param') == 'all':
|
||||
product = product.filter(
|
||||
@@ -152,19 +152,18 @@ class ProductExcelViewSet(viewsets.ModelViewSet):
|
||||
'',
|
||||
|
||||
]
|
||||
create_value(worksheet, list2, l + 3, 1, color='gray')
|
||||
create_value(worksheet, list2, l + 3, 1, color='gray') # noqa
|
||||
|
||||
workbook.save(output)
|
||||
output.seek(0)
|
||||
|
||||
response = HttpResponse(
|
||||
content_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
|
||||
content_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') # noqa
|
||||
response[
|
||||
'Content-Disposition'] = f'attachment; filename="سهمیه.xlsx"'.encode(
|
||||
'Content-Disposition'] = f'attachment; filename="سهمیه.xlsx"'.encode( # noqa
|
||||
'utf-8')
|
||||
response.write(output.getvalue())
|
||||
return response \
|
||||
|
||||
return response
|
||||
|
||||
# noqa # طرح های تشویقی
|
||||
@action(
|
||||
@@ -242,7 +241,7 @@ class ProductExcelViewSet(viewsets.ModelViewSet):
|
||||
'',
|
||||
|
||||
]
|
||||
create_value(worksheet, list2, l + 3, 1, color='gray')
|
||||
create_value(worksheet, list2, l + 3, 1, color='gray') # noqa
|
||||
|
||||
workbook.save(output)
|
||||
output.seek(0)
|
||||
@@ -250,7 +249,7 @@ class ProductExcelViewSet(viewsets.ModelViewSet):
|
||||
response = HttpResponse(
|
||||
content_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
|
||||
response[
|
||||
'Content-Disposition'] = f'attachment; filename="طرح های تشویقی.xlsx"'.encode(
|
||||
'Content-Disposition'] = f'attachment; filename="طرح های تشویقی.xlsx"'.encode( # noqa
|
||||
'utf-8')
|
||||
response.write(output.getvalue())
|
||||
return response
|
||||
|
||||
Reference in New Issue
Block a user