From 3dfe9d372f3f34714ed9caaa6c7b17e7091733f0 Mon Sep 17 00:00:00 2001 From: det Date: Tue, 7 Mar 2023 19:52:03 +0000 Subject: [PATCH] [FIX] account: add attachments to send&print Before this commit, it was not possible to add attachments to the send&print wizard (account.move.send) due to: https://github.com/odoo/odoo/commit/688986f888f2fe2371d58b74ded81315ba6bb353 closes odoo/odoo#114627 Signed-off-by: Laurent Smet --- .../src/components/mail_attachments/mail_attachments.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/static/src/components/mail_attachments/mail_attachments.js b/addons/account/static/src/components/mail_attachments/mail_attachments.js index b8d4aa7c2a1..e42f39beaa0 100644 --- a/addons/account/static/src/components/mail_attachments/mail_attachments.js +++ b/addons/account/static/src/components/mail_attachments/mail_attachments.js @@ -21,7 +21,7 @@ export class MailAttachments extends Component { } getValue(){ - return this.props.value || []; + return this.props.record.data[this.props.name] || []; } getUrl(attachmentId) { @@ -49,7 +49,7 @@ export class MailAttachments extends Component { placeholder: false, }); } - this.props.update(this.getValue().concat(extraFiles)); + this.props.record.update({ [this.props.name]: this.getValue().concat(extraFiles) }); } onFileRemove(deleteId) { @@ -58,7 +58,7 @@ export class MailAttachments extends Component { this.attachmentIdsToUnlink.add(item.id); } } - this.props.update(this.getValue().filter((item) => !this.attachmentIdsToUnlink.has(item.id))); + this.props.record.update({ [this.props.name]: this.getValue().filter((item) => !this.attachmentIdsToUnlink.has(item.id)) }); } async onWillUnmount(){