[FIX] mail: allow guest to delete attachments

closes odoo/odoo#121256

Related: odoo/enterprise#41025
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Sébastien Theys
2023-05-15 12:56:09 +02:00
parent c6b86893f2
commit bb627ae9de
@@ -101,9 +101,13 @@ export class AttachmentService {
async delete(attachment) {
this.remove(attachment);
if (attachment.id > 0) {
await this.rpc("/mail/attachment/delete", {
attachment_id: attachment.id,
});
await this.rpc(
"/mail/attachment/delete",
assignDefined(
{ attachment_id: attachment.id },
{ access_token: attachment.accessToken }
)
);
}
}
}