[REF] mail: move attachment deletable condition to discuss folder

Part of task-3265211

Part-of: odoo/odoo#125388
This commit is contained in:
Sébastien Theys
2023-06-19 16:39:56 +02:00
parent 97259f8076
commit 6f246d7fa2
2 changed files with 6 additions and 3 deletions
@@ -31,9 +31,6 @@ export class Attachment {
}
get isDeletable() {
if (this.message && this.originThread?.model === "discuss.channel") {
return this.message.editable;
}
return true;
}
@@ -5,6 +5,12 @@ import { Attachment } from "@mail/core/common/attachment_model";
import { patch } from "@web/core/utils/patch";
patch(Attachment.prototype, "discuss/core/common", {
get isDeletable() {
if (this.message && this.originThread?.model === "discuss.channel") {
return this.message.editable;
}
return this._super();
},
get urlRoute() {
if (!this.accessToken && this.originThread?.model === "discuss.channel") {
return this.isImage