From 9ec2f4cb445f28ff3d5b8566bbfa8820bc8215f3 Mon Sep 17 00:00:00 2001 From: Prakash Prajapati Date: Fri, 2 Apr 2021 10:52:18 +0000 Subject: [PATCH] [FIX] mail: fix the attachment traceback sync attachment Currently, traceback occurs when same attachments are sync with form view and bottom chatter and removed from chatter. So in this commit, on click of remove attachment dialog wait till the attachment id is removed from list of attachments. closes odoo/odoo#65093 Taskid: 2431478 Signed-off-by: Yannick Tivisse (yti) --- .../attachment_delete_confirm_dialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog.js b/addons/mail/static/src/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog.js index 36f0146a2eb..9843cb9304f 100644 --- a/addons/mail/static/src/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog.js +++ b/addons/mail/static/src/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog.js @@ -70,9 +70,9 @@ class AttachmentDeleteConfirmDialog extends Component { /** * @private */ - _onClickOk() { + async _onClickOk() { + await this.attachment.remove(); this._dialogRef.comp._close(); - this.attachment.remove(); this.trigger('o-attachment-removed', { attachmentLocalId: this.props.attachmentLocalId }); }