mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-29 03:46:29 -06:00
[IMP] attachment_zipped_download: Editable filename
This commit is contained in:
parent
62aaaa94c2
commit
7b2c4f68c0
@ -7,7 +7,7 @@ from odoo.http import request
|
|||||||
|
|
||||||
class AttachmentZippedDownloadController(http.Controller):
|
class AttachmentZippedDownloadController(http.Controller):
|
||||||
@http.route("/web/attachment/download_zip", type="http", auth="user")
|
@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
|
ids = [] if not ids else ids
|
||||||
if len(ids) == 0:
|
if len(ids) == 0:
|
||||||
return
|
return
|
||||||
@ -17,5 +17,5 @@ class AttachmentZippedDownloadController(http.Controller):
|
|||||||
filepath_or_fp=out_file,
|
filepath_or_fp=out_file,
|
||||||
mimetype="application/zip",
|
mimetype="application/zip",
|
||||||
as_attachment=True,
|
as_attachment=True,
|
||||||
filename=_("attachments.zip"),
|
filename=_("%s.zip") % filename,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user