<commit_before><?xml version="1.0" ?>
<openerp>

    <!-- Mail template are declared in a NOUPDATE block
         so users can freely customize/delete them -->
    <data noupdate="1">
        <!--Email template -->
        <record id="email_template_edi_invoice" model="mail.template">
            <field name="name">Invoice - Send by Email</field>
            <field name="email_from">${(object.user_id.email and '%s &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')|safe}</field>
            <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a'})</field>
            <field name="partner_to">${object.partner_id.id}</field>
            <field name="model_id" ref="account.model_account_invoice"/>
            <field name="auto_delete" eval="True"/>
            <field name="report_template" ref="account_invoices"/>
            <field name="report_name">Invoice_${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
            <field name="lang">${object.partner_id.lang}</field>
            <field name="body_html"><![CDATA[
% set access_action = object.get_access_action()
% set access_name = 'View invoice' if access_action and access_action['type'] == 'ir.actions.act_url' else 'See invoice'
% set access_url = access_action['type'] == 'ir.actions.act_url' and access_action['url'] or '/report/pdf/account.report_invoice/' + str(object.id)

<p>Dear
% if object.partner_id.is_company and object.child_ids:
    ${object.partner_id.child_ids[0].name}
% else :
    ${object.partner_id.name}
% endif
,</p>
<p>Thank you for your inquiry. Here is your invoice <strong>${object.number}</strong>
% if object.origin:
(with reference: ${object.origin} )
% endif
amounting in <strong>${object.amount_total} ${object.currency_id.name}</strong>
from ${object.company_id.name}.
</p>

<p style="margin-left: 30px;">
    <a href="${access_url}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#a24689; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #a24689; border: 1px solid #a24689; border-radius:3px" class="o_default_snippet_text">${access_name}</a>
</p>
<p>If you have any question, do not hesitate to contact us.</p>
<p>Best regards,</p>
% if object.user_id and object.user_id.signature:
    ${object.user_id.signature | safe}
% endif
]]></field>
        </record>
    </data>
</openerp>
<commit_msg>[IMP] account: improved email template for invoices<commit_after><?xml version="1.0" ?>
<openerp>

    <!-- Mail template are declared in a NOUPDATE block
         so users can freely customize/delete them -->
    <data noupdate="1">
        <!--Email template -->
        <record id="email_template_edi_invoice" model="mail.template">
            <field name="name">Invoice - Send by Email</field>
            <field name="email_from">${(object.user_id.email and '%s &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')|safe}</field>
            <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a'})</field>
            <field name="partner_to">${object.partner_id.id}</field>
            <field name="model_id" ref="account.model_account_invoice"/>
            <field name="auto_delete" eval="True"/>
            <field name="report_template" ref="account_invoices"/>
            <field name="report_name">Invoice_${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
            <field name="lang">${object.partner_id.lang}</field>
            <field name="body_html"><![CDATA[
% set access_action = object.get_access_action()
% set access_url = access_action['type'] == 'ir.actions.act_url' and access_action['url'] or '/report/pdf/account.report_invoice/' + str(object.id)

<p>Dear ${object.partner_id.name} 
% if object.partner_id.parent_id:
    (<i>${object.partner_id.parent_id.name}</i>)
% endif
,</p>
<p>Here is your invoice <strong>${object.number}</strong>
% if object.origin:
(with reference: ${object.origin} )
% endif
amounting in <strong>${object.amount_total} ${object.currency_id.name}</strong>
from ${object.company_id.name}.
</p>

    <br/><br/>
    <center>
      <a href="${access_url}"  style="background-color: #1abc9c; padding: 20px; text-decoration: none; color: #fff; border-radius: 5px; font-size: 16px;" class="o_default_snippet_text">View Invoice</a>
    </center>
    <br/><br/>

% if object.state=='paid':
    <p>This invoice is already paid.</p>
% else:
    <p>Please remit payment at your earliest convenience.</p>
% endif

<p>Thank you,</p>
% if object.user_id and object.user_id.signature:
    ${object.user_id.signature | safe}
% endif
]]></field>
        </record>

        <!--Default Notification Email template for invoices-->
        <record id="mail.mail_template_data_notification_email_account_invoice" model="mail.template">
            <field name="name">Invoice Notification Email</field>
            <field name="subject">${object.subject}</field>
            <field name="model_id" ref="mail.model_mail_message"/>
            <field name="auto_delete" eval="True"/>
            <field name="body_html"><![CDATA[<html>
                <head></head>
                <body style="margin: 0; padding: 0;">
                <table border="0" width="100%" cellpadding="0" bgcolor="#ededed" style="padding: 20px; background-color: #ededed">
                    <tbody>

                      <!-- HEADER -->
                      <tr>
                        <td align="center" style="min-width: 590px;">
                          <table width="590" border="0" cellpadding="0" bgcolor="#a24689" style="min-width: 590px; background-color: rgb(162, 70, 137); padding: 20px;">
                            <tr>
                              <td valign="middle">
                                  <span style="font-size:20px; color:white; font-weight: bold;">
                                      Invoice ${object.record_name}
                                  </span>
                              </td>
                              <td valign="middle" align="right">
                                  <img src="/logo.png" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}">
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>

                      <!-- CONTENT -->
                      <tr>
                        <td align="center" style="min-width: 590px;">
                          <table width="590" border="0" cellpadding="0" bgcolor="#ffffff" style="min-width: 590px; background-color: rgb(255, 255, 255); padding: 20px;">
                            <tbody>
                              <td valign="top" style="font-family:Arial,Helvetica,sans-serif; color: #555; font-size: 14px;">
                                ${object.body | safe}
                              </td>
                            </tbody>
                          </table>
                        </td>
                      </tr>

                      <!-- FOOTER -->
                      <tr>
                        <td align="center" style="min-width: 590px;">
                          <table width="590" border="0" cellpadding="0" bgcolor="#a24689" style="min-width: 590px; background-color: rgb(162, 70, 137); padding: 20px;">
                            <tr>
                              <td valign="middle" align="left" style="color: #fff; padding-top: 10px; padding-bottom: 10px; font-size: 12px;">
                                ${user.company_id.name}<br/>
                                ${user.company_id.phone or ''}
                              </td>
                              <td valign="middle" align="right" style="color: #fff; padding-top: 10px; padding-bottom: 10px; font-size: 12px;">
                                % if user.company_id.email:
                                <a href="mailto:${user.company_id.email}" style="text-decoration:none; color: white;">${user.company_id.email}</a><br/>
                                % endif
                                % if user.company_id.website:
                                    <a href="${user.company_id.website}" style="text-decoration:none; color: white;">
                                        ${user.company_id.website}
                                    </a>
                                % endif
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                      <tr>
                        <td align="center">
                            Powered by <a href="https://www.odoo.com">Odoo</a>.
                        </td>
                      </tr>
                    </tbody>
                </table>
                </body>
                </html>
            ]]></field>
        </record>

    </data>
</openerp>

{'fraction_non_alphanumeric': 0.1572532375666558, 'fraction_numerical': 0.01632386549134835, 'mean_word_length': 1.9174603174603175, 'pattern_counts': {'":': 0, '<': 171, '<?xml version=': 2, '>': 171, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 17, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4544010', 'n_tokens_mistral': 2840, 'n_tokens_neox': 2609, 'n_words': 560}