From 7b2c4f68c0c2315ef0b3531b8a82db0b5d97f675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Villarreal=20Ortega?= Date: Mon, 4 Jul 2022 12:46:48 +0200 Subject: [PATCH] [IMP] attachment_zipped_download: Editable filename --- attachment_zipped_download/controllers/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attachment_zipped_download/controllers/main.py b/attachment_zipped_download/controllers/main.py index f4b5f973..10c5489a 100644 --- a/attachment_zipped_download/controllers/main.py +++ b/attachment_zipped_download/controllers/main.py @@ -7,7 +7,7 @@ from odoo.http import request class AttachmentZippedDownloadController(http.Controller): @http.route("/web/attachment/download_zip", type="http", auth="user") - def download_zip(self, ids=None, debug=0): + def download_zip(self, ids=None, filename="attachments", debug=0): ids = [] if not ids else ids if len(ids) == 0: return @@ -17,5 +17,5 @@ class AttachmentZippedDownloadController(http.Controller): filepath_or_fp=out_file, mimetype="application/zip", as_attachment=True, - filename=_("attachments.zip"), + filename=_("%s.zip") % filename, )