<commit_before># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

import datetime

from odoo import api, fields, models

class MailComposeMessage(models.TransientModel):
    _inherit = 'mail.compose.message'

    @api.multi
    def send_mail(self, auto_commit=False):
        context = self._context
        # TODO TDE: clean that brole one day
        if self.model == 'sale.order':
            self.env['sale.order'].search([<commit_msg>[IMP] website_sale: Avoid traceback on send_mail when no active_ids<commit_after># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

import datetime

from odoo import api, fields, models

class MailComposeMessage(models.TransientModel):
    _inherit = 'mail.compose.message'

    @api.multi
    def send_mail(self, auto_commit=False):
        context = self._context
        # TODO TDE: clean that brole one day
        if self.model == 'sale.order' and context.get('active_ids'):
            self.env['sale.order'].search([
{'fraction_non_alphanumeric': 0.10754716981132076, 'fraction_numerical': 0.0018867924528301887, 'mean_word_length': 3.244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4663381', 'n_tokens_mistral': 321, 'n_tokens_neox': 310, 'n_words': 97}