<commit_before># Copyright (C) 2019 Compassion CH
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import html

from odoo import models, _


class MailMessage(models.Model):
    """
    Extend the mail composer so that it can send message to archived partner,
    and put back the selected partner in the claim in case it was not linked.
    """

    _inherit = "mail.message"

    def get_message_quote(self):
        """
        Helper to quote a message from another. This will return the message
        formatted for quoting.
        :return: HTML of quotted message
        """
        self.ensure_one()
        lib_subject = _("Subject")
        lib_from = _("From")
        lib_message = _("Original Message")
        header1 = '<div style="font-size:10pt;color:#1f497d">' "<br></div>"
        header2 = '<div style="font-size:10pt;color:#500050;">'
        header3 = "----" + lib_message + "----"
        br = "<br />"

        email_from = "no-email"
        if self.email_from:
            email_from = self.email_from
        email_from = (
            "<b>"
            + lib_from
            + "</b>:"
            + str(html.escape(email_from).encode("ascii", "xmlcharrefreplace"))
        )
        mail_date = "<b>Date</b>:" + self.date
        body = ""
        if self.body and self.body != u"":
            body = self.body.replace("#1f497d", "#500050") + "</div>"<commit_msg>Trying to reply to a support request does not trigger an error anymore<commit_after># Copyright (C) 2019 Compassion CH
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import html

from odoo import models, _


class MailMessage(models.Model):
    """
    Extend the mail composer so that it can send message to archived partner,
    and put back the selected partner in the claim in case it was not linked.
    """

    _inherit = "mail.message"

    def get_message_quote(self):
        """
        Helper to quote a message from another. This will return the message
        formatted for quoting.
        :return: HTML of quotted message
        """
        self.ensure_one()
        lib_subject = _("Subject")
        lib_from = _("From")
        lib_message = _("Original Message")
        header1 = '<div style="font-size:10pt;color:#1f497d">' "<br></div>"
        header2 = '<div style="font-size:10pt;color:#500050;">'
        header3 = "----" + lib_message + "----"
        br = "<br />"

        email_from = "no-email"
        if self.email_from:
            email_from = self.email_from
        email_from = (
            "<b>"
            + lib_from
            + "</b>:"
            + str(html.escape(email_from).encode("ascii", "xmlcharrefreplace"))
        )
        mail_date = "<b>Date</b>:" + str(self.date)
        body = ""
        if self.body and self.body != u"":
            body = self.body.replace("#1f497d", "#500050") + "</div>"
{'fraction_non_alphanumeric': 0.13809854267869534, 'fraction_numerical': 0.022900763358778626, 'mean_word_length': 2.157721796276013, 'pattern_counts': {'":': 2, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '7569307', 'n_tokens_mistral': 919, 'n_tokens_neox': 864, 'n_words': 241}