From a050a069b2f35e64a4629db64e749a8e12c7c960 Mon Sep 17 00:00:00 2001 From: Thanh Dodeur Date: Thu, 11 Feb 2021 10:48:00 +0000 Subject: [PATCH] [FIX] mail: prevent traceback on attachment unlink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to asynchronous rendering, the attachment template can be rendered when its attachment is undefined, this was causing an issue with an unguarded getter call that was attempting to access the attachment. This commit fixes this issue. opw-2457983 closes odoo/odoo#65992 X-original-commit: 33802c65c3e8d04c54de3fca5903f66b34b9d13a Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/components/attachment/attachment.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/components/attachment/attachment.xml b/addons/mail/static/src/components/attachment/attachment.xml index 27930259bdf..93b8e1620f7 100644 --- a/addons/mail/static/src/components/attachment/attachment.xml +++ b/addons/mail/static/src/components/attachment/attachment.xml @@ -6,7 +6,7 @@ t-att-class="{ 'o-downloadable': props.isDownloadable, 'o-editable': props.isEditable, - 'o-has-card-details': detailsMode === 'card', + 'o-has-card-details': attachment and detailsMode === 'card', 'o-isUploading': attachment and attachment.isUploading, 'o-viewable': attachment and attachment.isViewable, }" t-att-title="attachment ? attachment.displayName : undefined" t-att-data-attachment-local-id="attachment ? attachment.localId : undefined"