Browse Source

[MIG] fetchmail_notify_error_to_sender: Migration to 11.0

pull/1306/head
HaiDD 7 years ago
committed by Pedro M. Baeza
parent
commit
2839a1d3c7
  1. 3
      fetchmail_notify_error_to_sender/README.rst
  2. 3
      fetchmail_notify_error_to_sender/__init__.py
  3. 7
      fetchmail_notify_error_to_sender/__manifest__.py
  4. 4
      fetchmail_notify_error_to_sender/data/email_template_data.xml
  5. 2
      fetchmail_notify_error_to_sender/models/__init__.py
  6. 4
      fetchmail_notify_error_to_sender/models/fetchmail.py
  7. 2
      fetchmail_notify_error_to_sender/models/mail_thread.py

3
fetchmail_notify_error_to_sender/README.rst

@ -35,7 +35,7 @@ Usage
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/149/9.0
:target: https://runbot.odoo-community.org/runbot/149/11.0
Bug Tracker Bug Tracker
=========== ===========
@ -58,6 +58,7 @@ Contributors
* Lorenzo Battistini <lorenzo.battistini@agilebg.com> * Lorenzo Battistini <lorenzo.battistini@agilebg.com>
* Miquel Raïch <miquel.raich@eficent.com> (migration to v9 and v10) * Miquel Raïch <miquel.raich@eficent.com> (migration to v9 and v10)
* Hai Dinh <haidd.uit@gmail.com> (migration to V11)
Maintainer Maintainer
---------- ----------

3
fetchmail_notify_error_to_sender/__init__.py

@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
# Copyright 2017 Eficent <http://www.eficent.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models from . import models

7
fetchmail_notify_error_to_sender/__manifest__.py

@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com> # Copyright 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
# Copyright 2017 Eficent <http://www.eficent.com> # Copyright 2017 Eficent <http://www.eficent.com>
# Copyright 2018 Hai Dinh <haidd.uit@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
'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': '10.0.1.0.0',
'version': '11.0.1.0.0',
'category': 'Tools', 'category': 'Tools',
'author': "Agile Business Group,Eficent,Odoo Community Association (OCA)",
'author':
"Agile Business Group,Eficent,Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/server-tools', 'website': 'https://github.com/OCA/server-tools',
'license': 'AGPL-3', 'license': 'AGPL-3',
'depends': [ 'depends': [

4
fetchmail_notify_error_to_sender/data/email_template_data.xml

@ -11,14 +11,14 @@
<field name="user_signature" eval="True"/> <field name="user_signature" eval="True"/>
<field name="lang">${ctx.get('lang')}</field> <field name="lang">${ctx.get('lang')}</field>
<field name="body_html"><![CDATA[ <field name="body_html"><![CDATA[
<div>
<div>
<p>Hello ${ctx.get('sender_message').get('from')},</p> <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>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>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').message}</i></p> <p><i>${ctx.get('route_exception').message}</i></p>
</div>
</div>
]]></field> ]]></field>
</record> </record>
</odoo> </odoo>

2
fetchmail_notify_error_to_sender/models/__init__.py

@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent <http://www.eficent.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import fetchmail from . import fetchmail

4
fetchmail_notify_error_to_sender/models/fetchmail.py

@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com> # Copyright 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
# Copyright 2017 Eficent <http://www.eficent.com> # Copyright 2017 Eficent <http://www.eficent.com>
# Copyright 2018 Hai Dinh <haidd.uit@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models from odoo import fields, models
class FetchmailServer(models.Model): class FetchmailServer(models.Model):
_inherit = 'fetchmail.server' _inherit = 'fetchmail.server'
error_notice_template_id = fields.Many2one( error_notice_template_id = fields.Many2one(
'mail.template', string="Error notice template", 'mail.template', string="Error notice template",
help="Set here the template to use to send notice to sender when " help="Set here the template to use to send notice to sender when "

2
fetchmail_notify_error_to_sender/models/mail_thread.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2015-2017 Lorenzo Battistini <lorenzo.battistini@agilebg.com> # Copyright 2015-2017 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
# Copyright 2017 Eficent <http://www.eficent.com> # Copyright 2017 Eficent <http://www.eficent.com>
# Copyright 2018 Hai Dinh <haidd.uit@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models from odoo import api, models

Loading…
Cancel
Save