Merge PR #2583 into 15.0

Signed-off-by pedrobaeza
pull/2587/head
OCA-git-bot 2023-03-16 14:35:20 +00:00
commit e0b9f2e7dd
4 changed files with 65 additions and 17 deletions

View File

@ -6,7 +6,7 @@
{
"name": "Fetchmail Notify Error 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",
"author": "Agile Business Group,ForgeFlow,Odoo Community Association (OCA)",
"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">
<!--Email template -->
<record id="email_template_error_notice" model="mail.template">
<field name="name">Fetchmail - error notice</field>
<field name="email_from">${ctx.get('sender_message').get('to')|safe}</field>
<field name="email_to">${ctx.get('sender_message').get('from')|safe}</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="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="auto_delete" eval="True" />
<field name="lang">${ctx.get('lang')}</field>
<field
name="body_html"
><![CDATA[
<div>
<p>Hello ${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>Maybe you used a wrong recipient address?</p>
<p><br/></p>
<p>Technical details:</p>
<p><i>${ctx.get('route_exception')}</i></p>
<field name="lang">{{ctx.get('lang')}}</field>
<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>
</record>
</odoo>

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",
)