[FIX] website_sale: render mail template when sending only one mail

The email_compose_message_wizard_form takes a default_composition_mode.
If it is 'mass_mail', the used mail template is not rendered.
Since this is basically unreadable for a normal user, this can be confusing.
Note that this is even the case if the mail is being sent on only one record.

We use the 'comment' composition mode if there is only one target record so that
the template is rendered in that case.

opw 1984381

closes odoo/odoo#33173

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
This commit is contained in:
Nans Lefebvre
2019-05-06 08:34:03 +00:00
parent 9cb9e227c9
commit 2ff0ebd63b
+1 -1
View File
@@ -350,7 +350,7 @@ class SaleOrder(models.Model):
'view_id': composer_form_view_id,
'target': 'new',
'context': {
'default_composition_mode': 'mass_mail',
'default_composition_mode': 'mass_mail' if len(self.ids) > 1 else 'comment',
'default_res_id': self.ids[0],
'default_model': 'sale.order',
'default_use_template': bool(template_id),