From 2ff0ebd63b38878a4b7c6691cb86639df119ac0e Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Mon, 6 May 2019 08:31:12 +0000 Subject: [PATCH] [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) --- addons/website_sale/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py index 05db43f9f4b..3411c8fade3 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -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),