[FIX] mail: remove unnecessary getattr

We can access fields directly on a record, no need to have a getattr.

closes odoo/odoo#98287

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Thibault Delavallée
2022-08-18 15:07:57 +02:00
parent 6942fd3e28
commit 7fb4d8f919
+2 -2
View File
@@ -543,12 +543,12 @@ class MailComposer(models.TransientModel):
if template_id and composition_mode == 'mass_mail':
template = self.env['mail.template'].browse(template_id)
values = dict(
(field, getattr(template, field))
(field, template[field])
for field in ['subject', 'body_html',
'email_from',
'reply_to',
'mail_server_id']
if getattr(template, field)
if template[field]
)
if template.attachment_ids:
values['attachment_ids'] = [att.id for att in template.attachment_ids]