From ede53e34b726731663566659ed34cd3a02d8894a Mon Sep 17 00:00:00 2001 From: Martin Quinteros Date: Thu, 7 Nov 2024 16:04:59 -0300 Subject: [PATCH] [FIX] Fix Download attachment This commit (https://github.com/odoo/odoo/commit/366676cafdce00d55823c6daf41452b0c2373e4d) move download buttans into a sub-component. I modified the module behavior to use canDownload() method instead of adding a t-if in the view and prevent the chatter component from breaking when the message has attachments. --- document_url/static/src/js/url.esm.js | 5 +++++ document_url/static/src/xml/url.xml | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/document_url/static/src/js/url.esm.js b/document_url/static/src/js/url.esm.js index b11953e7043..2ecfb553696 100644 --- a/document_url/static/src/js/url.esm.js +++ b/document_url/static/src/js/url.esm.js @@ -52,6 +52,11 @@ patch(AttachmentList.prototype, { * * @returns {String} */ + canDownload(attachment) { + return ( + super.canDownload(attachment) && attachment.mimetype != "application/link" + ); + }, get attachmentUrl() { return url("/web/content", { id: this.attachment.id, diff --git a/document_url/static/src/xml/url.xml b/document_url/static/src/xml/url.xml index ce6793b61e5..be6b7ad3297 100644 --- a/document_url/static/src/xml/url.xml +++ b/document_url/static/src/xml/url.xml @@ -30,12 +30,6 @@ - - attachment.mimetype != 'application/link' -