[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
This commit is contained in:
Thibault Delavallée
2021-12-07 11:50:54 +00:00
parent e8796e6302
commit 836428788d
+2 -1
View File
@@ -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)