[FIX] mail: when performing pure email mass mailing
attachments were not formatted as a m2m command but a list
of ids. This is now fixed.
[FIX] email_template: when generating reports
in batch, update the values for all res_ids, not only the
last one of the current template.
[FIX] mail: when generating pure email mass mailing
we have to process attachments as well as attachment_ids in the values generated
by the composer and the optional template.
As this behavior is the same as the one already implemented for message_post, this
feature has been moved into its dedicated method to be called by message_post
or before calling mail_mail.create().
This also allows to have attachments in pure email mass mailing that are attached
to mail.message, not to mail.compose.message model. When unlinking those emails,
the attachments will be also removed, and not lost in the database anymore.
[FIX] mail: attachments encoding issue: posting process
waits not encoded attachments: email_template encodes them. So de-encoding
is necessary.
[FIX] email_template: fixing to have the correct report suppose to correctly fix. So, fix the fix to fix it
[DOC] mail: cleaned a comment
[MERGE] Sync with saas-2
[MERGE] Sync with saas-2
[MERGE] [FIX] mail: attachments in pure email mass mailing.

When generating pure email mass mailing, the values are directly sent to mail_mail.create() instead of going through mail_thread.message_post(). We therefore have to process attachments (coming from email_template, as a list of tuples (attachment_name, b64-encoded attachment_content)) as well as attachment_ids, like it is done in message_post.
As this behavior is the same as the one already implemented for message_post, this feature has been moved into its dedicated method called by message_post or called before going into mail_mail.create(), depending on the mailing type.

[FIX] email_template: when generating reports in batch, correctly attach the generate attachments to the various record ids we are iterating on.