[FIX] fetchmail_notify_error_to_sender: jinja -> qweb

pull/2982/head
Miquel Raïch 2023-03-16 14:41:52 +01:00 committed by BT-cjimeno
parent a09a339b8c
commit 6b7239bfcd
No known key found for this signature in database
5 changed files with 77 additions and 26 deletions

View File

@ -6,7 +6,7 @@
{ {
"name": "Fetchmail Notify Error to Sender", "name": "Fetchmail Notify Error to Sender",
"summary": "If fetching mails gives error, send an email to sender", "summary": "If fetching mails gives error, send an email to sender",
"version": "15.0.1.0.0", "version": "15.0.1.0.1",
"category": "Tools", "category": "Tools",
"author": "Agile Business Group,ForgeFlow,Odoo Community Association (OCA)", "author": "Agile Business Group,ForgeFlow,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-tools", "website": "https://github.com/OCA/server-tools",

View File

@ -1,27 +1,31 @@
<?xml version="1.0" ?> <?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1"> <odoo noupdate="1">
<!--Email template --> <!--Email template -->
<record id="email_template_error_notice" model="mail.template"> <record id="email_template_error_notice" model="mail.template">
<field name="name">Fetchmail - error notice</field> <field name="name">Fetchmail - error notice</field>
<field name="email_from">${ctx.get('sender_message').get('to')|safe}</field> <field name="email_from">{{ctx.get('sender_message').get('to')}}</field>
<field name="email_to">${ctx.get('sender_message').get('from')|safe}</field> <field name="email_to">{{ctx.get('sender_message').get('from')}}</field>
<field <field
name="subject" name="subject"
>Receiving error with: ${ctx.get('sender_message').get('subject')|safe}</field> >Receiving error with: {{ctx.get('sender_message').get('subject')}}</field>
<field name="model_id" ref="fetchmail.model_fetchmail_server" /> <field name="model_id" ref="fetchmail.model_fetchmail_server" />
<field name="auto_delete" eval="True" /> <field name="auto_delete" eval="True" />
<field name="lang">${ctx.get('lang')}</field> <field name="lang">{{ctx.get('lang')}}</field>
<field <field name="body_html" type="html">
name="body_html" <div style="margin: 0px; padding: 0px;">
><![CDATA[ <p style="margin: 0px; padding: 0px; font-size: 13px;">
<div> <div>
<p>Hello ${ctx.get('sender_message').get('from')},</p> <p>Hello <t t-out="ctx.get('sender_message').get('from')" />,</p>
<p>we got a problem with your email: <i>${ctx.get('sender_message').get('subject')}</i></p> <p>we got a problem with your email: <i><t
t-out="ctx.get('sender_message').get('subject')"
/></i></p>
<p>Maybe you used a wrong recipient address?</p> <p>Maybe you used a wrong recipient address?</p>
<p><br/></p> <p><br /></p>
<p>Technical details:</p> <p>Technical details:</p>
<p><i>${ctx.get('route_exception')}</i></p> <p><i><t t-out="ctx.get('route_exception')" /></i></p>
</div> </div>
]]></field> </p>
</div>
</field>
</record> </record>
</odoo> </odoo>

View File

@ -16,14 +16,17 @@ msgstr ""
#. module: fetchmail_notify_error_to_sender #. module: fetchmail_notify_error_to_sender
#: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice
msgid "" msgid ""
"\n" "<div style=\"margin: 0px; padding: 0px;\">\n"
" <p style=\"margin: 0px; padding: 0px; font-size: 13px;\">\n"
" <div>\n" " <div>\n"
" <p>Hello ${ctx.get('sender_message').get('from')},</p>\n" " <p>Hello <t t-out=\"ctx.get('sender_message').get('from')\"/>,</p>\n"
" <p>we got a problem with your email: <i>${ctx.get('sender_message').get('subject')}</i></p>\n" " <p>we got a problem with your email: <i><t t-out=\"ctx.get('sender_message').get('subject')\"/></i></p>\n"
" <p>Maybe you used a wrong recipient address?</p>\n" " <p>Maybe you used a wrong recipient address?</p>\n"
" <p><br/></p>\n" " <p><br/></p>\n"
" <p>Technical details:</p>\n" " <p>Technical details:</p>\n"
" <p><i>${ctx.get('route_exception')}</i></p>\n" " <p><i><t t-out=\"ctx.get('route_exception')\"/></i></p>\n"
" </div>\n"
" </p>\n"
" </div>\n" " </div>\n"
" " " "
msgstr "" msgstr ""
@ -50,7 +53,7 @@ msgstr ""
#. module: fetchmail_notify_error_to_sender #. module: fetchmail_notify_error_to_sender
#: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice #: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice
msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" msgid "Receiving error with: {{ctx.get('sender_message').get('subject')}}"
msgstr "" msgstr ""
#. module: fetchmail_notify_error_to_sender #. module: fetchmail_notify_error_to_sender

View File

@ -0,0 +1,33 @@
<?xml version='1.0' encoding='utf-8' ?>
<odoo>
<record id="email_template_error_notice" model="mail.template">
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
<div>
<p>Hello <t t-out="ctx.get('sender_message').get('from')" />,</p>
<p>we got a problem with your email: <i><t
t-out="ctx.get('sender_message').get('subject')"
/></i></p>
<p>Maybe you used a wrong recipient address?</p>
<p>
<br />
</p>
<p>Technical details:</p>
<p>
<i>
<t t-out="ctx.get('route_exception')" />
</i>
</p>
</div>
</p>
</div>
</field>
<field name="email_from">{{ctx.get('sender_message').get('to')}}</field>
<field name="email_to">{{ctx.get('sender_message').get('from')}}</field>
<field name="lang">{{ctx.get('lang')}}</field>
<field
name="subject"
>Receiving error with: {{ctx.get('sender_message').get('subject')}}</field>
</record>
</odoo>

View File

@ -0,0 +1,11 @@
# Copyright 2023 ForgeFlow <http://www.forgeflow.com>
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
openupgrade.load_data(
env.cr,
"fetchmail_notify_error_to_sender",
"migrations/15.0.1.0.1/noupdate_changes.xml",
)