Skip to content
Snippets Groups Projects
Commit eee6e26b authored by Nans Lefebvre's avatar Nans Lefebvre
Browse files

[FIX] mail_enterprise: display all attachements in preview widget


If res_id is not defined, this method used to crash.
Made obvious by commit a26496b6,
which added a call to that function in the main controller of web.

opw 1950403

closes odoo/odoo#31923

Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
parent 273fc4af
No related branches found
No related tags found
No related merge requests found
......@@ -23,5 +23,5 @@ class IrAttachment(models.Model):
related_record = self.env[self.res_model].browse(self.res_id)
# message_main_attachment_id field can be empty, that's why we compare to False;
# we are just checking that it exists on the model before writing it
if hasattr(related_record, 'message_main_attachment_id'):
if related_record and hasattr(related_record, 'message_main_attachment_id'):
related_record.message_main_attachment_id = self
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment