summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanh Dodeur <tso@odoo.com>2021-02-11 10:48:00 +0000
committerThanh Dodeur <tso@odoo.com>2021-02-11 10:48:00 +0000
commit156f35de1bafd5982812bc216a9daf3405a9b724 (patch)
tree5401c0b896e31d167c1b97ba09353daa876a1074
parent2558768aadc1ab80443472ae9911b39f0b818d95 (diff)
[FIX] mail: prevent traceback on attachment unlink
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#65944 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
-rw-r--r--addons/mail/static/src/components/attachment/attachment.xml2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/static/src/components/attachment/attachment.xml b/addons/mail/static/src/components/attachment/attachment.xml
index 96e96b407ee..938ff8942c1 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-temporary': attachment and attachment.isTemporary,
'o-viewable': attachment and attachment.isViewable,
}" t-att-title="attachment ? attachment.displayName : undefined" t-att-data-attachment-local-id="attachment ? attachment.localId : undefined"