From 836428788d8042c82c0a24b7fdd34be5d26b6e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 7 Dec 2021 09:48:52 +0000 Subject: [PATCH] [FIX] sms: do not force a void context When scheduling a mass sms with a template, do not force a void body in context as default value. Indeed it takes precedence on computation of body based on template and may lead to a void value being given to create. Task-2709581 Part-of: odoo/odoo#80947 --- addons/sms/models/mail_thread.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/sms/models/mail_thread.py b/addons/sms/models/mail_thread.py index be76e797a48..c8a80d38288 100644 --- a/addons/sms/models/mail_thread.py +++ b/addons/sms/models/mail_thread.py @@ -157,8 +157,9 @@ class MailThread(models.AbstractModel): 'default_res_model': self._name, 'default_composition_mode': 'mass', 'default_template_id': template.id if template else False, - 'default_body': body if body and not template else False, } + if body and not template: + composer_context['default_body'] = body if active_domain is not None: composer_context['default_use_active_domain'] = True composer_context['default_active_domain'] = repr(active_domain)