mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-21 12:52:18 -06:00
[MIG] attachment_zipped_download: Migration to 18.0
TT54112
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import zipfile
|
||||
from io import BytesIO
|
||||
|
||||
from odoo import _, models
|
||||
from odoo import models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@ class IrAttachment(models.Model):
|
||||
items = self.filtered(lambda x: x.type == "binary")
|
||||
if not items:
|
||||
raise UserError(
|
||||
_("None attachment selected. Only binary attachments allowed.")
|
||||
self.env._("None attachment selected. Only binary attachments allowed.")
|
||||
)
|
||||
ids = ",".join(map(str, items.ids))
|
||||
return {
|
||||
"type": "ir.actions.act_url",
|
||||
"url": "/web/attachment/download_zip?ids=%s" % (ids),
|
||||
"url": f"/web/attachment/download_zip?ids={ids}",
|
||||
"target": "self",
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user