[FIX] document_url: Fix Download attachment component

Fix download atachment widget.

Document_url when activated causes error when opening attachment link on the chatter window
This commit (366676cafd) move download buttons 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.
This commit is contained in:
Martin Quinteros
2024-11-07 16:04:59 -03:00
parent 2853b873b6
commit 0b11b08d40
2 changed files with 5 additions and 6 deletions

View File

@@ -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,