[FIX] mail: send email from CRM using a template

When sending emails from CRM, you can save the mail as a new template.
Despite having selected the desired recipients, the mails sent will not
have any recipients.

Steps to reproduce:
1. Install CRM and open the app
2. Trigger the list view of the pipeline
3. Select any opportunities, go to Action and click on 'Send email'
4. Give a subject to the email and click on 'SAVE AS NEW TEMPLATE'
5. Send the email
6. Go to emails, there are no recipients for the emails generated

Solution:
Set the `use_default_to` to true by default when using the 'SAVE AS NEW
TEMPLATE' button

opw-2827177

X-original-commit: 1180b8cd9f0ed5bebdef97d702f29a5652fa6ac8
Part-of: odoo/odoo#93025
This commit is contained in:
Merlin (megu)
2022-06-08 11:20:43 +02:00
committed by MerlinGuillaume
parent cc6d3a52ac
commit de95dee062
@@ -335,6 +335,7 @@ class MailComposer(models.TransientModel):
'subject': record.subject or False,
'body_html': record.body or False,
'model_id': model.id or False,
'use_default_to': True,
}
template = self.env['mail.template'].create(values)