<commit_before># -*- coding: utf-8 -*-
# License AGPL-3: Antiun Ingenieria S.L. - <NAME>
# See README.rst file on addon root folder for more details

from openerp import models, api


class MailMail(models.Model):
    _inherit = 'mail.mail'

    @api.model
    def email_to_list_get(self, mail):
        email_list = []
        if mail.email_to:
            email_to = self.send_get_mail_to(mail)
            email_list += email_to
        for partner in mail.recipient_ids:
            email_to = self.send_get_mail_to(mail, partner=partner)
            email_list += email_to
        return email_list

    @api.model
    def create(self, vals):
        mail = super(MailMail, self).create(vals)
        if vals.get('statistics_ids'):
            email_list = self.email_to_list_get(mail)
            for stat in mail.statistics_ids:
                stat.write({
                    'email_from': mail.email_from,
                    'email_to': ';'.join(email_list),
                    'subject': mail.subject,
                })
        return mail
<commit_msg> [FIX] fix bug with standard emails sending<commit_after># -*- coding: utf-8 -*-
# License AGPL-3: Antiun Ingenieria S.L. - <NAME>
# See README.rst file on addon root folder for more details

from openerp import models, api


class MailMail(models.Model):
    _inherit = 'mail.mail'

    @api.model
    def email_to_list_get(self, mail):
        email_list = []
        if mail.email_to:
            email_to = self.send_get_mail_to(mail)
            email_list += email_to
        for partner in mail.recipient_ids:
            email_to = self.send_get_mail_to(mail, partner=partner)
            email_list += email_to
        return email_list

    @api.model
    def create(self, vals):
        mail = super(MailMail, self).create(vals)
        if vals.get('statistics_ids'):
            email_list = self.email_to_list_get(mail)
            for stat in mail.statistics_ids:
                stat.write({
                    'email_from': mail.email_from,
                    'email_to': ';'.join(email_list),
                    'subject': mail.subject,
                })
        return mail_id

{'fraction_non_alphanumeric': 0.10069284064665127, 'fraction_numerical': 0.0018475750577367205, 'mean_word_length': 1.9752747252747254, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1453549', 'n_tokens_mistral': 679, 'n_tokens_neox': 658, 'n_words': 155}