[FIX] mail: fix attachment removed when editing message

when a message or logenote with attachment(s) is edited attachment gets removed
even if user does not want to delete attachment.

after this commit,
editing message text will update only message and attachment will not be removed.
attachment will be deleted only when user wants to delete it

closes odoo/odoo#78785

X-original-commit: dbd6cf34d3fcf9d66657b68766d2a25ee0d2515b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Krunal Trivedi
2021-10-21 22:18:44 +00:00
parent 27e0307c07
commit b39a2ca3a8
@@ -433,7 +433,7 @@ function factory(dependencies) {
body = this._generateEmojisOnHtml(body);
let data = {
body: body,
attachment_ids: composer.attachments.concat(this.messageViewInEditing.message.originThread.attachments).map(attachment => attachment.id),
attachment_ids: composer.attachments.concat(this.messageViewInEditing.message.attachments).map(attachment => attachment.id),
};
try {
composer.update({ isPostingMessage: true });