From 680675e8149acf1b09214f9652f6f8e6bb7dab75 Mon Sep 17 00:00:00 2001 From: eLBati Date: Tue, 30 Jun 2015 19:35:54 +0200 Subject: [PATCH 01/29] [ADD] module fetchmail_notify_error_to_sender --- fetchmail_notify_error_to_sender/README.rst | 50 ++++++++++ fetchmail_notify_error_to_sender/__init__.py | 22 +++++ .../__openerp__.py | 40 ++++++++ .../email_template_data.xml | 27 ++++++ fetchmail_notify_error_to_sender/fetchmail.py | 30 ++++++ .../fetchmail_view.xml | 16 +++ fetchmail_notify_error_to_sender/i18n/de.po | 61 ++++++++++++ fetchmail_notify_error_to_sender/i18n/es.po | 90 +++++++++++++++++ fetchmail_notify_error_to_sender/i18n/fr.po | 91 ++++++++++++++++++ fetchmail_notify_error_to_sender/i18n/it.po | 69 +++++++++++++ .../i18n/pt_BR.po | 61 ++++++++++++ .../i18n/pt_PT.po | 60 ++++++++++++ fetchmail_notify_error_to_sender/i18n/sl.po | 61 ++++++++++++ fetchmail_notify_error_to_sender/i18n/tr.po | 61 ++++++++++++ .../mail_thread.py | 75 +++++++++++++++ .../static/description/icon.png | Bin 0 -> 3274 bytes 16 files changed, 814 insertions(+) create mode 100644 fetchmail_notify_error_to_sender/README.rst create mode 100644 fetchmail_notify_error_to_sender/__init__.py create mode 100644 fetchmail_notify_error_to_sender/__openerp__.py create mode 100644 fetchmail_notify_error_to_sender/email_template_data.xml create mode 100644 fetchmail_notify_error_to_sender/fetchmail.py create mode 100644 fetchmail_notify_error_to_sender/fetchmail_view.xml create mode 100644 fetchmail_notify_error_to_sender/i18n/de.po create mode 100644 fetchmail_notify_error_to_sender/i18n/es.po create mode 100644 fetchmail_notify_error_to_sender/i18n/fr.po create mode 100644 fetchmail_notify_error_to_sender/i18n/it.po create mode 100644 fetchmail_notify_error_to_sender/i18n/pt_BR.po create mode 100644 fetchmail_notify_error_to_sender/i18n/pt_PT.po create mode 100644 fetchmail_notify_error_to_sender/i18n/sl.po create mode 100644 fetchmail_notify_error_to_sender/i18n/tr.po create mode 100644 fetchmail_notify_error_to_sender/mail_thread.py create mode 100644 fetchmail_notify_error_to_sender/static/description/icon.png diff --git a/fetchmail_notify_error_to_sender/README.rst b/fetchmail_notify_error_to_sender/README.rst new file mode 100644 index 00000000000..b8dbd0ad13f --- /dev/null +++ b/fetchmail_notify_error_to_sender/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +Send notice on fetchmail errors +=============================== + +If fetchmail is not able to correctly route an email, the email is "silently" lost (you get an error message in server log). +For example, if you configure odoo mail system to route received emails according to recipient address, it may happen users send emails to wrong email address. + +This module allows to automatically send a notification email to sender, when odoo can't correctly process the received email. + + +Configuration +============= + +Configure your fetchmail server setting 'Error notice template' = 'Fetchmail - error notice'. +You can edit the 'Fetchmail - error notice' email template according to your needs. + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + + +Credits +======= + +Contributors +------------ + +* Lorenzo Battistini + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/fetchmail_notify_error_to_sender/__init__.py b/fetchmail_notify_error_to_sender/__init__.py new file mode 100644 index 00000000000..6caf7ed3b8f --- /dev/null +++ b/fetchmail_notify_error_to_sender/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2015 Lorenzo Battistini +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import mail_thread +from . import fetchmail diff --git a/fetchmail_notify_error_to_sender/__openerp__.py b/fetchmail_notify_error_to_sender/__openerp__.py new file mode 100644 index 00000000000..3dc0ee4baf3 --- /dev/null +++ b/fetchmail_notify_error_to_sender/__openerp__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2015 Lorenzo Battistini +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Send notice on fetchmail errors', + 'summary': 'If fetching mails gives error, send an email to sender', + 'version': '8.0.1.0.0', + 'category': 'Tools', + 'author': "Agile Business Group,Odoo Community Association (OCA)", + 'website': 'http://www.agilebg.com', + 'license': 'AGPL-3', + 'depends': [ + 'fetchmail', + ], + 'data': [ + 'fetchmail_view.xml', + 'email_template_data.xml', + ], + 'qweb': [ + ], + 'installable': True, + 'auto_install': False, +} diff --git a/fetchmail_notify_error_to_sender/email_template_data.xml b/fetchmail_notify_error_to_sender/email_template_data.xml new file mode 100644 index 00000000000..6d98a9725fb --- /dev/null +++ b/fetchmail_notify_error_to_sender/email_template_data.xml @@ -0,0 +1,27 @@ + + + + + + + Fetchmail - error notice + ${ctx.get('sender_message').get('to')|safe} + ${ctx.get('sender_message').get('from')|safe} + Receiving error with: ${ctx.get('sender_message').get('subject')|safe} + + + + ${ctx.get('lang')} + +

Hello ${ctx.get('sender_message').get('from')},

+

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

+

Maybe you used a wrong recipient address?

+


+

Technical details:

+

${ctx.get('route_exception').message}

+ + ]]>
+
+
+
diff --git a/fetchmail_notify_error_to_sender/fetchmail.py b/fetchmail_notify_error_to_sender/fetchmail.py new file mode 100644 index 00000000000..97233d48674 --- /dev/null +++ b/fetchmail_notify_error_to_sender/fetchmail.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2015 Lorenzo Battistini +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp import models, fields + + +class fetchmail_server(models.Model): + + _inherit = 'fetchmail.server' + error_notice_template_id = fields.Many2one( + 'email.template', string="Error notice template", + help="Set here the template to use to send notice to sender when " + "errors occur while fetching email") diff --git a/fetchmail_notify_error_to_sender/fetchmail_view.xml b/fetchmail_notify_error_to_sender/fetchmail_view.xml new file mode 100644 index 00000000000..2364f95adab --- /dev/null +++ b/fetchmail_notify_error_to_sender/fetchmail_view.xml @@ -0,0 +1,16 @@ + + + + + + fetchmail.server.form + fetchmail.server + + + + + + + + + diff --git a/fetchmail_notify_error_to_sender/i18n/de.po b/fetchmail_notify_error_to_sender/i18n/de.po new file mode 100644 index 00000000000..6fac306b4b0 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/de.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-19 14:44+0000\n" +"PO-Revision-Date: 2016-01-18 14:02+0000\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-8-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "\n
\n

Hallo ${ctx.get('sender_message').get('from')},

\n

wir haben ein Problem mit Ihrer Email: ${ctx.get('sender_message').get('subject')}

\n

Vielleicht haben Sie nur die falsche Empfängeradresse angegeben?

\n


\n

Technische Details:

\n

${ctx.get('route_exception').message}

\n
\n " + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Email-Thread" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "Fehlerhinweis-Vorlage" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "POP/IMAP Server" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "Erhalte Fehler mit: ${ctx.get('sender_message').get('subject')|safe}" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "Legen Sie hier die Vorlage fest, die verwendet werden soll, um Hinweise an Benutzer zu senden, wenn Fehler beim Nachrichten Abholen auftreten." diff --git a/fetchmail_notify_error_to_sender/i18n/es.po b/fetchmail_notify_error_to_sender/i18n/es.po new file mode 100644 index 00000000000..ec8a4777920 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/es.po @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Ahmet Altınışık , 2016 +# Antonio Trueba, 2016 +# Antonio Trueba, 2016 +# bossnm11 , 2014 +# Carles Antoli , 2015 +# Chanseok , 2014 +# Chul Park , 2015 +# David10000 , 2014 +# FIRST AUTHOR , 2012-2013 +# Gil , 2014 +# Hongseob Lee , 2015 +# Hongseob Lee , 2015 +# Hotellook, 2014 +# jeon , 2014 +# JiyeonLee , 2014 +# Jong-Dae Park , 2013 +# Kevin Min , 2015 +# KimKyudong , 2014 +# mariana1201 , 2014 +# Matjaž Mozetič , 2015-2016 +# Nicole , 2014 +# Paolo Valier, 2016 +# Pope, 2014 +# Rudolf Schnapka , 2016 +# Sarina Canelake , 2014 +# Seok Jun Yoon , 2015 +# shin2012 , 2014 +# Sujin Lee , 2014 +# Sunah Lim , 2013 +# Young Kim , 2015 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-14 07:02+0000\n" +"PO-Revision-Date: 2016-04-07 17:54+0000\n" +"Last-Translator: Antonio Trueba\n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "\n
\n

Hola ${ctx.get('sender_message').get('from')},

\n

tenemos un problema con su email: ${ctx.get('sender_message').get('subject')}

\n

¿Puede haber usado una dirección de destino incorrecta?

\n


\n

Detalles técnicos:

\n

${ctx.get('route_exception').message}

\n
\n " + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Hilo correo electrónico" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "Servidor POP/IMAP" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "" diff --git a/fetchmail_notify_error_to_sender/i18n/fr.po b/fetchmail_notify_error_to_sender/i18n/fr.po new file mode 100644 index 00000000000..b77689ef9b1 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/fr.po @@ -0,0 +1,91 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Ahmet Altinisik , 2016 +# Antonio Trueba, 2016 +# Armando Vulcano Junior , 2015 +# bossnm11 , 2014 +# Chanseok , 2014 +# Christophe CHAUVET , 2015 +# Chul Park , 2015 +# David10000 , 2014 +# FIRST AUTHOR , 2012-2013 +# Gil , 2014 +# kmooc , 2015 +# Hongseob Lee , 2015 +# Hotellook, 2014 +# jeon , 2014 +# JiyeonLee , 2014 +# Jong-Dae Park , 2013 +# Kevin Min , 2015 +# KimKyudong , 2014 +# mariana1201 , 2014 +# Matjaž Mozetič , 2015 +# Nicole , 2014 +# Pedro M. Baeza , 2015 +# Pope, 2014 +# SaFi J. , 2015 +# Sarina Canelake , 2014 +# Seok Jun Yoon , 2015 +# shin2012 , 2014 +# Sujin Lee , 2014 +# Sunah Lim , 2013 +# Young C. Kim, 2015 +# Zwygart , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-28 21:29+0000\n" +"PO-Revision-Date: 2016-10-11 22:10+0000\n" +"Last-Translator: Zwygart \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-server-tools-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "\n
\n

Bonjour ${ctx.get('sender_message').get('from')},

\n

nous avons de la difficulté avec votre adresse de courriel: ${ctx.get('sender_message').get('subject')}

\n

Peut-être avez-vous utilisé une mauvaise adresse de destinataire?

\n


\n

Détails techniques:

\n

${ctx.get('route_exception').message}

\n
" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Discussion de courriel" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "Erreur dans le modèle de notice" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "Serveur POP/IMAP" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "Reçu une erreur avec : ${ctx.get('sender_message').get('subject')|safe}" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "Choisissez ici le modèle à utiliser pour informer l'expéditeur lorsque des erreurs surviennent lors de la récupération du courriel. " diff --git a/fetchmail_notify_error_to_sender/i18n/it.po b/fetchmail_notify_error_to_sender/i18n/it.po new file mode 100644 index 00000000000..ac1646bca37 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/it.po @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Armando Vulcano Junior , 2015 +# danimaribeiro , 2016 +# FIRST AUTHOR , 2011-2012 +# Hotellook, 2014 +# Leonardo J. Caballero G. , 2016 +# Matjaž Mozetič , 2015-2016 +# Paolo Valier, 2016 +# Paolo Valier, 2016 +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-28 00:59+0000\n" +"PO-Revision-Date: 2016-07-31 08:52+0000\n" +"Last-Translator: Paolo Valier\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Discussione Email" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "Modello per il messaggio di errore" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "Server POP/IMAP" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "" diff --git a/fetchmail_notify_error_to_sender/i18n/pt_BR.po b/fetchmail_notify_error_to_sender/i18n/pt_BR.po new file mode 100644 index 00000000000..9da09368c45 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/pt_BR.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Armando Vulcano Junior , 2015 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-29 11:14+0000\n" +"PO-Revision-Date: 2015-09-18 22:16+0000\n" +"Last-Translator: Armando Vulcano Junior \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Processo Email" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "Modelo de aviso de erro" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "Servidor POP/IMAP" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "Recebendo erro com: ${ctx.get('sender_message').get('subject')|safe}" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "Configure aqui o modelo para usar para enviar aviso ao remetente quando ocorrer erro durante a carga de email" diff --git a/fetchmail_notify_error_to_sender/i18n/pt_PT.po b/fetchmail_notify_error_to_sender/i18n/pt_PT.po new file mode 100644 index 00000000000..52d4494b345 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/pt_PT.po @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-16 09:29+0000\n" +"PO-Revision-Date: 2015-09-18 13:55+0000\n" +"Last-Translator: <>\n" +"Language-Team: Portuguese (Portugal) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/pt_PT/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_PT\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Tópico de Email" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "" diff --git a/fetchmail_notify_error_to_sender/i18n/sl.po b/fetchmail_notify_error_to_sender/i18n/sl.po new file mode 100644 index 00000000000..7f8037100b4 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/sl.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Matjaž Mozetič , 2015 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-29 11:14+0000\n" +"PO-Revision-Date: 2015-09-26 07:45+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "\n
\n

Pozdravljeni ${ctx.get('sender_message').get('from')}.

\n

Z vašim e-poštnim sporočilom imamo težave: ${ctx.get('sender_message').get('subject')}

\n

Ste mogoče uporabili napačen e-poštni naslov?

\n


\n

Tehnični podatki:

\n

${ctx.get('route_exception').message}

\n
\n " + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "E-poštna nit" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "Predloga obvestila o napaki" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "POP/IMAP strežnik" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "Napaka pri prejemu: ${ctx.get('sender_message').get('subject')|safe}" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "Nastavite predlogo, ki bo uporabljena za pošiljanje obvestila pošiljatelju, kadar se bi pojavile napake pri prejemu e-pošte" diff --git a/fetchmail_notify_error_to_sender/i18n/tr.po b/fetchmail_notify_error_to_sender/i18n/tr.po new file mode 100644 index 00000000000..09a8e6c41a8 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/tr.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Ahmet Altınışık , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-19 14:44+0000\n" +"PO-Revision-Date: 2016-01-31 13:32+0000\n" +"Last-Translator: Ahmet Altınışık \n" +"Language-Team: Turkish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/tr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: tr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "\n
\n

Merhaba ${ctx.get('sender_message').get('from')},

\n

E-postanız ile ilgili bir problem var: ${ctx.get('sender_message').get('subject')}

\n

Belki alıcı adresi yanlıştır?

\n


\n

Teknik detaylar:

\n

${ctx.get('route_exception').message}

\n
\n " + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Eposta konuşması" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "Hata bildirim şablonu" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "POP/IMAP sunucu" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "Alınan hata : ${ctx.get('sender_message').get('subject')|safe}" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "E-posta alınırken oluşan hatalarda gönderilecek bildirim mesajı için şablonu belirleyin." diff --git a/fetchmail_notify_error_to_sender/mail_thread.py b/fetchmail_notify_error_to_sender/mail_thread.py new file mode 100644 index 00000000000..19eddcac482 --- /dev/null +++ b/fetchmail_notify_error_to_sender/mail_thread.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2015 Lorenzo Battistini +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.osv import osv + + +class mail_thread(osv.AbstractModel): + _inherit = 'mail.thread' + + def message_route_verify( + self, cr, uid, message, message_dict, route, update_author=True, + assert_model=True, create_fallback=True, allow_private=False, + context=None + ): + res = () + if context is None: + context = {} + try: + res = super(mail_thread, self).message_route_verify( + cr, uid, message, message_dict, route, + update_author=update_author, assert_model=assert_model, + create_fallback=create_fallback, allow_private=allow_private, + context=context) + except ValueError as ve: + fetchmail_server_id = context.get('fetchmail_server_id') + if not fetchmail_server_id: + raise ve + fetchmail_server = self.pool['fetchmail.server'].browse( + cr, uid, fetchmail_server_id, context) + if not fetchmail_server.error_notice_template_id: + raise ve + context['sender_message'] = message + context['route_exception'] = ve + self.pool['email.template'].send_mail( + cr, uid, fetchmail_server.error_notice_template_id.id, + fetchmail_server.id, context=context) + context['error_notice_sent'] = True + return res + + def message_route( + self, cr, uid, message, message_dict, model=None, thread_id=None, + custom_values=None, context=None + ): + if context is None: + context = {} + res = [] + try: + res = super(mail_thread, self).message_route( + cr, uid, message, message_dict, model=model, + thread_id=thread_id, custom_values=custom_values, + context=context) + except ValueError as ve: + if context.get('error_notice_sent'): + # avoid raising exception and setting mail message UNSEEN + return [] + else: + raise ve + return res diff --git a/fetchmail_notify_error_to_sender/static/description/icon.png b/fetchmail_notify_error_to_sender/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..955b8138f60c5e0a115b989c2e9569cf53c880af GIT binary patch literal 3274 zcmb7{i8CAQ7RF;~qbNyHw6(=9wvVE=+QkxEYY$Ots^zmU6(zI?MM>38P;2bFqP9}C zwM6X{wQJCnT0h*}d;fqt_nkTCnRnhfGiT;E=b7`yni|8d)8C>8007tZ^|T*Q6!Y(( zyGqF)?>i1rgw{_}-<*zeLg`$vl>0SrJsUp&fPv-TK?TUn<^TW~J@mCT%!9Lca_p1t zSg`e9Zuox{=SxZ_4NLxJGmOG%M)ayzL_X56N!8>vgIcF_V6j(R_BC*XmoCj2Ic%je z0$Co~-7?#+oXnowKMw{C(MnM3LB#a=m~G$k4!|QLdTYkVH;!wRhg|NXL)uVoQ)lQb zwAZ2^YHwz4WBzQ9yX%oO2jkTj-T$X(wP__Flf0uhl71`bcth)lsqfwF>$(UBvoD2f zlC$ena*P7nZxqQbGL3$CP`q9etTlXWn?fU#Qad8lwy`LB>cyIK=8M^VD?mR_jQ3chJlcZS9|*!#3*8CQa6cJf<>{^o zkmW`9G|e=X?ylBPjtD=nYdQ`1)5>tgHwYSS0pDcmS}I!|NOW|>90 z67gvBjB$Fn?oE2tpSy%RhKY`)A@T(}UDo#zvMontZ7k^|Ke@*n1sqB~)5r+a0JPHZ zU_BMLEhG)QiEW|xt{9fYh`_ytSH2Tf^Tt7doJr&M6>ibL2U(Y5sh;rI?MT z9JasP31^2oFRl)O{MkQO-P$VOMq<>aU}39mH0&YQ_@RE_DQoRL_JyL++PMNVBS2y$)m32=WAD`U#3Dp7&7W};F-8EztdyuoNxN~P~s$h)?kQWy1 zJ(;;U%jhUTR67yjk*M7ApI4sv*g@7gtpkd=mK(@EW(KO?M$yHMSn!{B%*$BL+^^De z5CG!V2(5P@?|l-R9A`gK0RY2r?JQ;Vf`oO&q+)>RAYQLOm9Sk`TpF+YO<6U=-{YB0 z@sHA+%@JnsW6+Y1&YHnL+Cp+`38b!Pm!|6pE4TarvqMz6jubqE`NS_1zK-tp@?49M z-d6>~AX;DD*uCMx6@=kWC99z*{ed0co);_4g|OHi7y}+l@}ja0%!7FWxqh4r1a>l6^w%@lZnUUz^dDd8vud zxCkD3%TKC!foUw^E@@`KqZC7OL#8X@x@{73twhxR-1}e@AM>%s=G9>kU`#<@S}iMX z=Wu-9DjKAN4>N7gZu~J9_v%Y&8;+C5ZHXV%`@FP85-rkkUA@$VCXG1B#2fh{cUr*( zsKk^qDVV*iIB@@{Pgj-}eCI$MjZA-j8kKLDR8Wif#t4(L+HCDXS=cK$=h(>ycGs_h zw{Urf|0I;zlUd%VNq`MC>Sw59=i2C(P>?CI}_(?LNqqzGif;k!Vv1X?^W zF+{{C`AofW00?jjRpHxJBovSkwUwZD%cm6@k6C~m7PIEl;a+y`56>C%)jy(7udES2 z`s%w+#QJ-%+f2yP){ed?8ITCwwS_JS%sNa7xQ93M+dE$|d1Lsp4nYid2Lem08m^U= zRR=_a{7vwjQ#OHN;Y7}kss_od?cgHc=)AAFdVRT2NwWCfU(zP~jy|oWN7gO&i~| z_4(K!ueY?{XQTzUov2{Qf~$6`PrDNX0D~17qX+zAsX5tUfe%4Kg3DT9!SA;pO0@{3!Rx2V*H9V4AC!a)4=?-k}2 z!2?4AncDz}Zzgt6tX-@qJtGlb|LwV3!2lt@?)II|HsXb5#MV>)XwMBKYF!(|LOrl5 z8n#x(dM>IWgPD?gcF;b-rEY;o4<_FQHU5RTCHH3Kp9NFs5s~9%`#g7<6H#JZ#9-kW&lu{eg`>Yka8{CSgXa zR;uv~?c1aAI+En~`>;1;Z-{sPPC>GX@M(LSCP|9GrmlhskvS*trCKDAw!HX8&#A&{ z3O&u1EoLH)Xu1pEv8yj!cMON!m`U>YH>u342Sco>R_#GjrFTzcxiTh2-`i`qsD-vk z6v3CvGaZ1Y6J65M@HE1z)}aj+*ooZ#!ar_Q#+ zJ|fJMUYqaArIkcqEU{+i4f(KZ1W3s`u*O#2gg|U4?!}fSNZA*xO_(O4y{i3%#=NB* z8H*sa!ZXV4FpDrVadajew6bhKzvwn2WpM-89YcdfbQ-Z?y%^Sh6>*uhs}N?n-sS!B zoCJx9#?l;^-3DJw1vA1eIa&*kYf8+Q=fnq7dapmY6n4fe0(U~|AYHGwMMJZ61Oyjg*P?GavfH+A&gq!%a^GgxwCTPAQY=n`8Vmbz4rxhPMwD z7nNcEvc(4=?qtPnNcQQpI{ps4cSwsLVC>zsNLHi|WsaOekS)tC`9|?+ z1mE-j_S3@sMi%Bpz3}1vGtGmZ;4^YH@YidY(w>XhMFGBP=a*eq??>z@KX)Cxf%`GMDNyDsz>w}E1yP$>_Dbyjpa$! z_xo7wmJtT#%->l>W78&{pd!1jZu&-7n=u1t4`aj!L9c1+pMFU8hzv~*RM(G+5&E)9 z!*AfkP2I4qc1n9HQz=Lt6bi^gG0c#M$MUak z893Ebf8(pY_yEOj?Ip*lWJTyPrP}4_8$Em1GF<@(z}iuWX`0`-{XbXu$7&Zq{ZID> Vn$ItZl+Or2U&mOxO7l_VzW@d(7|;L! literal 0 HcmV?d00001 From 1d493c00d24f3eeb28ba7fafc6412479d5536f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Alix?= Date: Sat, 19 Nov 2016 22:41:02 +0100 Subject: [PATCH 02/29] Fix Travis (#616) * [FIX] auth_from_http_remote_user - Lint * [FIX] server_environment - Lint * [FIX] base_module_doc_rst - Lint * [FIX] fetchmail_notify_error_to_sender - Fix XML view, it was the 'active' field from 'fetchmail_attach_from_folder' module which was targeted by mistake (belonging to another data model) --- fetchmail_notify_error_to_sender/__openerp__.py | 2 +- fetchmail_notify_error_to_sender/fetchmail_view.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fetchmail_notify_error_to_sender/__openerp__.py b/fetchmail_notify_error_to_sender/__openerp__.py index 3dc0ee4baf3..9b75e26b278 100644 --- a/fetchmail_notify_error_to_sender/__openerp__.py +++ b/fetchmail_notify_error_to_sender/__openerp__.py @@ -21,7 +21,7 @@ { 'name': 'Send notice on fetchmail errors', 'summary': 'If fetching mails gives error, send an email to sender', - 'version': '8.0.1.0.0', + 'version': '8.0.1.0.1', 'category': 'Tools', 'author': "Agile Business Group,Odoo Community Association (OCA)", 'website': 'http://www.agilebg.com', diff --git a/fetchmail_notify_error_to_sender/fetchmail_view.xml b/fetchmail_notify_error_to_sender/fetchmail_view.xml index 2364f95adab..c7223b29aea 100644 --- a/fetchmail_notify_error_to_sender/fetchmail_view.xml +++ b/fetchmail_notify_error_to_sender/fetchmail_view.xml @@ -7,9 +7,9 @@ fetchmail.server - - - + + + From 840c8dd1be50bfb3bc1b0796a81332e063d13bb5 Mon Sep 17 00:00:00 2001 From: mreficent Date: Thu, 13 Apr 2017 10:25:12 +0200 Subject: [PATCH 03/29] [MIG] fetchmail_notify_error_to_sender --- fetchmail_notify_error_to_sender/README.rst | 49 +++++++++--- fetchmail_notify_error_to_sender/__init__.py | 24 +----- .../__openerp__.py | 33 +++----- .../{ => data}/email_template_data.xml | 3 +- fetchmail_notify_error_to_sender/fetchmail.py | 30 -------- fetchmail_notify_error_to_sender/i18n/ca.po | 61 +++++++++++++++ fetchmail_notify_error_to_sender/i18n/de.po | 36 ++++++--- fetchmail_notify_error_to_sender/i18n/es.po | 4 +- fetchmail_notify_error_to_sender/i18n/fr.po | 68 +++++++---------- fetchmail_notify_error_to_sender/i18n/hr.po | 61 +++++++++++++++ fetchmail_notify_error_to_sender/i18n/it.po | 28 +++---- .../i18n/pt_BR.po | 24 +++--- .../i18n/pt_PT.po | 4 +- fetchmail_notify_error_to_sender/i18n/sl.po | 36 ++++++--- fetchmail_notify_error_to_sender/i18n/tr.po | 36 ++++++--- .../i18n/zh_CN.po | 61 +++++++++++++++ .../mail_thread.py | 75 ------------------- .../models/__init__.py | 6 ++ .../models/fetchmail.py | 15 ++++ .../models/mail_thread.py | 53 +++++++++++++ .../{ => views}/fetchmail_view.xml | 11 +-- 21 files changed, 436 insertions(+), 282 deletions(-) rename fetchmail_notify_error_to_sender/{ => data}/email_template_data.xml (93%) delete mode 100644 fetchmail_notify_error_to_sender/fetchmail.py create mode 100644 fetchmail_notify_error_to_sender/i18n/ca.po create mode 100644 fetchmail_notify_error_to_sender/i18n/hr.po create mode 100644 fetchmail_notify_error_to_sender/i18n/zh_CN.po delete mode 100644 fetchmail_notify_error_to_sender/mail_thread.py create mode 100644 fetchmail_notify_error_to_sender/models/__init__.py create mode 100644 fetchmail_notify_error_to_sender/models/fetchmail.py create mode 100644 fetchmail_notify_error_to_sender/models/mail_thread.py rename fetchmail_notify_error_to_sender/{ => views}/fetchmail_view.xml (71%) diff --git a/fetchmail_notify_error_to_sender/README.rst b/fetchmail_notify_error_to_sender/README.rst index b8dbd0ad13f..813be264e12 100644 --- a/fetchmail_notify_error_to_sender/README.rst +++ b/fetchmail_notify_error_to_sender/README.rst @@ -1,38 +1,63 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License: AGPL-3 + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +=============================== Send notice on fetchmail errors =============================== -If fetchmail is not able to correctly route an email, the email is "silently" lost (you get an error message in server log). -For example, if you configure odoo mail system to route received emails according to recipient address, it may happen users send emails to wrong email address. +If fetchmail is not able to correctly route an email, the email is +"silently" lost (you get an error message in server log). + +For example, if you configure odoo mail system to route received emails +according to recipient address, it may happen users send emails to wrong +email address. -This module allows to automatically send a notification email to sender, when odoo can't correctly process the received email. +This module extends the functionality of fetchmail to allow you to +automatically send a notification email to sender, when odoo can't +correctly process the received email. Configuration ============= -Configure your fetchmail server setting 'Error notice template' = 'Fetchmail - error notice'. -You can edit the 'Fetchmail - error notice' email template according to your needs. +To configure this module, you need to: + +#. Configure your fetchmail server setting 'Error notice template' = 'Fetchmail - error notice'. +#. You can edit the 'Fetchmail - error notice' email template according to your needs. + +.. figure:: path/to/local/image.png + :alt: alternative description + :width: 600 px +Usage +===== + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/149/9.0 Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. - +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smash it by providing detailed and welcomed feedback. Credits ======= +Images +------ + +* Odoo Community Association: `Icon `_. + Contributors ------------ * Lorenzo Battistini +* Miquel Raïch (migration to v9) Maintainer ---------- @@ -47,4 +72,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file diff --git a/fetchmail_notify_error_to_sender/__init__.py b/fetchmail_notify_error_to_sender/__init__.py index 6caf7ed3b8f..226b25b5f3e 100644 --- a/fetchmail_notify_error_to_sender/__init__.py +++ b/fetchmail_notify_error_to_sender/__init__.py @@ -1,22 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Lorenzo Battistini -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2015 Lorenzo Battistini +# Copyright 2017 Eficent +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from . import mail_thread -from . import fetchmail +from . import models diff --git a/fetchmail_notify_error_to_sender/__openerp__.py b/fetchmail_notify_error_to_sender/__openerp__.py index 9b75e26b278..97d87cbd01e 100644 --- a/fetchmail_notify_error_to_sender/__openerp__.py +++ b/fetchmail_notify_error_to_sender/__openerp__.py @@ -1,40 +1,25 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Lorenzo Battistini -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2015 Lorenzo Battistini +# Copyright 2017 Eficent +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Send notice on fetchmail errors', 'summary': 'If fetching mails gives error, send an email to sender', - 'version': '8.0.1.0.1', + 'version': '9.0.1.0.0', 'category': 'Tools', - 'author': "Agile Business Group,Odoo Community Association (OCA)", - 'website': 'http://www.agilebg.com', + 'author': "Agile Business Group,Eficent,Odoo Community Association (OCA)", + 'website': 'https://github.com/OCA/server-tools', 'license': 'AGPL-3', 'depends': [ 'fetchmail', ], 'data': [ - 'fetchmail_view.xml', - 'email_template_data.xml', + 'views/fetchmail_view.xml', + 'data/email_template_data.xml', ], 'qweb': [ ], 'installable': True, - 'auto_install': False, + 'application': False, } diff --git a/fetchmail_notify_error_to_sender/email_template_data.xml b/fetchmail_notify_error_to_sender/data/email_template_data.xml similarity index 93% rename from fetchmail_notify_error_to_sender/email_template_data.xml rename to fetchmail_notify_error_to_sender/data/email_template_data.xml index 6d98a9725fb..3bfbb212d76 100644 --- a/fetchmail_notify_error_to_sender/email_template_data.xml +++ b/fetchmail_notify_error_to_sender/data/email_template_data.xml @@ -1,9 +1,8 @@ - - + Fetchmail - error notice ${ctx.get('sender_message').get('to')|safe} ${ctx.get('sender_message').get('from')|safe} diff --git a/fetchmail_notify_error_to_sender/fetchmail.py b/fetchmail_notify_error_to_sender/fetchmail.py deleted file mode 100644 index 97233d48674..00000000000 --- a/fetchmail_notify_error_to_sender/fetchmail.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Lorenzo Battistini -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp import models, fields - - -class fetchmail_server(models.Model): - - _inherit = 'fetchmail.server' - error_notice_template_id = fields.Many2one( - 'email.template', string="Error notice template", - help="Set here the template to use to send notice to sender when " - "errors occur while fetching email") diff --git a/fetchmail_notify_error_to_sender/i18n/ca.po b/fetchmail_notify_error_to_sender/i18n/ca.po new file mode 100644 index 00000000000..b197c79aa57 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/ca.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Marc Tormo i Bochaca , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-15 02:48+0000\n" +"PO-Revision-Date: 2017-07-15 02:48+0000\n" +"Last-Translator: Marc Tormo i Bochaca , 2017\n" +"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ca\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Tema del Correu electrònic " + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id +msgid "Error notice template" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "Servidor POP/IMAP" + +#. module: fetchmail_notify_error_to_sender +#: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "" diff --git a/fetchmail_notify_error_to_sender/i18n/de.po b/fetchmail_notify_error_to_sender/i18n/de.po index 6fac306b4b0..1a9bbca95f4 100644 --- a/fetchmail_notify_error_to_sender/i18n/de.po +++ b/fetchmail_notify_error_to_sender/i18n/de.po @@ -3,15 +3,15 @@ # * fetchmail_notify_error_to_sender # # Translators: -# Rudolf Schnapka , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-19 14:44+0000\n" -"PO-Revision-Date: 2016-01-18 14:02+0000\n" -"Last-Translator: Rudolf Schnapka \n" -"Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-8-0/language/de/)\n" +"POT-Creation-Date: 2017-07-15 02:48+0000\n" +"PO-Revision-Date: 2017-07-15 02:48+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: fetchmail_notify_error_to_sender -#: model:email.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 "" "\n" "
\n" @@ -31,7 +31,17 @@ msgid "" "

${ctx.get('route_exception').message}

\n" "
\n" " " -msgstr "\n
\n

Hallo ${ctx.get('sender_message').get('from')},

\n

wir haben ein Problem mit Ihrer Email: ${ctx.get('sender_message').get('subject')}

\n

Vielleicht haben Sie nur die falsche Empfängeradresse angegeben?

\n


\n

Technische Details:

\n

${ctx.get('route_exception').message}

\n
\n " +msgstr "" +"\n" +"
\n" +"

Hallo ${ctx.get('sender_message').get('from')},

\n" +"

wir haben ein Problem mit Ihrer Email: ${ctx.get('sender_message').get('subject')}

\n" +"

Vielleicht haben Sie nur die falsche Empfängeradresse angegeben?

\n" +"


\n" +"

Technische Details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread @@ -39,7 +49,7 @@ msgid "Email Thread" msgstr "Email-Thread" #. module: fetchmail_notify_error_to_sender -#: field:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "Error notice template" msgstr "Fehlerhinweis-Vorlage" @@ -49,13 +59,15 @@ msgid "POP/IMAP Server" msgstr "POP/IMAP Server" #. module: fetchmail_notify_error_to_sender -#: model:email.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}" msgstr "Erhalte Fehler mit: ${ctx.get('sender_message').get('subject')|safe}" #. module: fetchmail_notify_error_to_sender -#: help:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" -msgstr "Legen Sie hier die Vorlage fest, die verwendet werden soll, um Hinweise an Benutzer zu senden, wenn Fehler beim Nachrichten Abholen auftreten." +msgstr "" +"Legen Sie hier die Vorlage fest, die verwendet werden soll, um Hinweise an " +"Benutzer zu senden, wenn Fehler beim Nachrichten Abholen auftreten." diff --git a/fetchmail_notify_error_to_sender/i18n/es.po b/fetchmail_notify_error_to_sender/i18n/es.po index ec8a4777920..e73ea6f16ee 100644 --- a/fetchmail_notify_error_to_sender/i18n/es.po +++ b/fetchmail_notify_error_to_sender/i18n/es.po @@ -48,7 +48,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: fetchmail_notify_error_to_sender -#: model:email.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 "" "\n" "
\n" @@ -78,7 +78,7 @@ msgid "POP/IMAP Server" msgstr "Servidor POP/IMAP" #. module: fetchmail_notify_error_to_sender -#: model:email.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}" msgstr "" diff --git a/fetchmail_notify_error_to_sender/i18n/fr.po b/fetchmail_notify_error_to_sender/i18n/fr.po index b77689ef9b1..1af7b0bf479 100644 --- a/fetchmail_notify_error_to_sender/i18n/fr.po +++ b/fetchmail_notify_error_to_sender/i18n/fr.po @@ -3,45 +3,15 @@ # * fetchmail_notify_error_to_sender # # Translators: -# Ahmet Altinisik , 2016 -# Antonio Trueba, 2016 -# Armando Vulcano Junior , 2015 -# bossnm11 , 2014 -# Chanseok , 2014 -# Christophe CHAUVET , 2015 -# Chul Park , 2015 -# David10000 , 2014 -# FIRST AUTHOR , 2012-2013 -# Gil , 2014 -# kmooc , 2015 -# Hongseob Lee , 2015 -# Hotellook, 2014 -# jeon , 2014 -# JiyeonLee , 2014 -# Jong-Dae Park , 2013 -# Kevin Min , 2015 -# KimKyudong , 2014 -# mariana1201 , 2014 -# Matjaž Mozetič , 2015 -# Nicole , 2014 -# Pedro M. Baeza , 2015 -# Pope, 2014 -# SaFi J. , 2015 -# Sarina Canelake , 2014 -# Seok Jun Yoon , 2015 -# shin2012 , 2014 -# Sujin Lee , 2014 -# Sunah Lim , 2013 -# Young C. Kim, 2015 -# Zwygart , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-28 21:29+0000\n" -"PO-Revision-Date: 2016-10-11 22:10+0000\n" -"Last-Translator: Zwygart \n" -"Language-Team: French (http://www.transifex.com/oca/OCA-server-tools-8-0/language/fr/)\n" +"POT-Creation-Date: 2017-07-15 02:48+0000\n" +"PO-Revision-Date: 2017-07-15 02:48+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -49,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: fetchmail_notify_error_to_sender -#: model:email.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 "" "\n" "
\n" @@ -61,7 +31,16 @@ msgid "" "

${ctx.get('route_exception').message}

\n" "
\n" " " -msgstr "\n
\n

Bonjour ${ctx.get('sender_message').get('from')},

\n

nous avons de la difficulté avec votre adresse de courriel: ${ctx.get('sender_message').get('subject')}

\n

Peut-être avez-vous utilisé une mauvaise adresse de destinataire?

\n


\n

Détails techniques:

\n

${ctx.get('route_exception').message}

\n
" +msgstr "" +"\n" +"
\n" +"

Bonjour ${ctx.get('sender_message').get('from')},

\n" +"

nous avons de la difficulté avec votre adresse de courriel: ${ctx.get('sender_message').get('subject')}

\n" +"

Peut-être avez-vous utilisé une mauvaise adresse de destinataire?

\n" +"


\n" +"

Détails techniques:

\n" +"

${ctx.get('route_exception').message}

\n" +"
" #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread @@ -69,7 +48,7 @@ msgid "Email Thread" msgstr "Discussion de courriel" #. module: fetchmail_notify_error_to_sender -#: field:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "Error notice template" msgstr "Erreur dans le modèle de notice" @@ -79,13 +58,16 @@ msgid "POP/IMAP Server" msgstr "Serveur POP/IMAP" #. module: fetchmail_notify_error_to_sender -#: model:email.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}" -msgstr "Reçu une erreur avec : ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" +"Reçu une erreur avec : ${ctx.get('sender_message').get('subject')|safe}" #. module: fetchmail_notify_error_to_sender -#: help:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" -msgstr "Choisissez ici le modèle à utiliser pour informer l'expéditeur lorsque des erreurs surviennent lors de la récupération du courriel. " +msgstr "" +"Choisissez ici le modèle à utiliser pour informer l'expéditeur lorsque des " +"erreurs surviennent lors de la récupération du courriel. " diff --git a/fetchmail_notify_error_to_sender/i18n/hr.po b/fetchmail_notify_error_to_sender/i18n/hr.po new file mode 100644 index 00000000000..e0dd9bad54c --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/hr.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-15 02:48+0000\n" +"PO-Revision-Date: 2017-07-15 02:48+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: fetchmail_notify_error_to_sender +#: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id +msgid "Error notice template" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "POP/IMAP Server" + +#. module: fetchmail_notify_error_to_sender +#: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "" diff --git a/fetchmail_notify_error_to_sender/i18n/it.po b/fetchmail_notify_error_to_sender/i18n/it.po index ac1646bca37..cd3f6386a46 100644 --- a/fetchmail_notify_error_to_sender/i18n/it.po +++ b/fetchmail_notify_error_to_sender/i18n/it.po @@ -3,23 +3,15 @@ # * fetchmail_notify_error_to_sender # # Translators: -# Armando Vulcano Junior , 2015 -# danimaribeiro , 2016 -# FIRST AUTHOR , 2011-2012 -# Hotellook, 2014 -# Leonardo J. Caballero G. , 2016 -# Matjaž Mozetič , 2015-2016 -# Paolo Valier, 2016 -# Paolo Valier, 2016 -# Rudolf Schnapka , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-28 00:59+0000\n" -"PO-Revision-Date: 2016-07-31 08:52+0000\n" -"Last-Translator: Paolo Valier\n" -"Language-Team: Italian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/it/)\n" +"POT-Creation-Date: 2017-07-15 02:48+0000\n" +"PO-Revision-Date: 2017-07-15 02:48+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -27,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: fetchmail_notify_error_to_sender -#: model:email.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 "" "\n" "
\n" @@ -47,7 +39,7 @@ msgid "Email Thread" msgstr "Discussione Email" #. module: fetchmail_notify_error_to_sender -#: field:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "Error notice template" msgstr "Modello per il messaggio di errore" @@ -57,12 +49,12 @@ msgid "POP/IMAP Server" msgstr "Server POP/IMAP" #. module: fetchmail_notify_error_to_sender -#: model:email.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}" msgstr "" #. module: fetchmail_notify_error_to_sender -#: help:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" diff --git a/fetchmail_notify_error_to_sender/i18n/pt_BR.po b/fetchmail_notify_error_to_sender/i18n/pt_BR.po index 9da09368c45..ab6b8200eed 100644 --- a/fetchmail_notify_error_to_sender/i18n/pt_BR.po +++ b/fetchmail_notify_error_to_sender/i18n/pt_BR.po @@ -3,15 +3,15 @@ # * fetchmail_notify_error_to_sender # # Translators: -# Armando Vulcano Junior , 2015 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-18 22:16+0000\n" -"Last-Translator: Armando Vulcano Junior \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/pt_BR/)\n" +"POT-Creation-Date: 2017-07-15 02:48+0000\n" +"PO-Revision-Date: 2017-07-15 02:48+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: fetchmail_notify_error_to_sender -#: model:email.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 "" "\n" "
\n" @@ -39,7 +39,7 @@ msgid "Email Thread" msgstr "Processo Email" #. module: fetchmail_notify_error_to_sender -#: field:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "Error notice template" msgstr "Modelo de aviso de erro" @@ -49,13 +49,15 @@ msgid "POP/IMAP Server" msgstr "Servidor POP/IMAP" #. module: fetchmail_notify_error_to_sender -#: model:email.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}" msgstr "Recebendo erro com: ${ctx.get('sender_message').get('subject')|safe}" #. module: fetchmail_notify_error_to_sender -#: help:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" -msgstr "Configure aqui o modelo para usar para enviar aviso ao remetente quando ocorrer erro durante a carga de email" +msgstr "" +"Configure aqui o modelo para usar para enviar aviso ao remetente quando " +"ocorrer erro durante a carga de email" diff --git a/fetchmail_notify_error_to_sender/i18n/pt_PT.po b/fetchmail_notify_error_to_sender/i18n/pt_PT.po index 52d4494b345..2b9a8719da2 100644 --- a/fetchmail_notify_error_to_sender/i18n/pt_PT.po +++ b/fetchmail_notify_error_to_sender/i18n/pt_PT.po @@ -18,7 +18,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: fetchmail_notify_error_to_sender -#: model:email.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 "" "\n" "
\n" @@ -48,7 +48,7 @@ msgid "POP/IMAP Server" msgstr "" #. module: fetchmail_notify_error_to_sender -#: model:email.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}" msgstr "" diff --git a/fetchmail_notify_error_to_sender/i18n/sl.po b/fetchmail_notify_error_to_sender/i18n/sl.po index 7f8037100b4..3368404c9cc 100644 --- a/fetchmail_notify_error_to_sender/i18n/sl.po +++ b/fetchmail_notify_error_to_sender/i18n/sl.po @@ -3,15 +3,15 @@ # * fetchmail_notify_error_to_sender # # Translators: -# Matjaž Mozetič , 2015 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-26 07:45+0000\n" -"Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/sl/)\n" +"POT-Creation-Date: 2017-07-15 02:48+0000\n" +"PO-Revision-Date: 2017-07-15 02:48+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" #. module: fetchmail_notify_error_to_sender -#: model:email.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 "" "\n" "
\n" @@ -31,7 +31,17 @@ msgid "" "

${ctx.get('route_exception').message}

\n" "
\n" " " -msgstr "\n
\n

Pozdravljeni ${ctx.get('sender_message').get('from')}.

\n

Z vašim e-poštnim sporočilom imamo težave: ${ctx.get('sender_message').get('subject')}

\n

Ste mogoče uporabili napačen e-poštni naslov?

\n


\n

Tehnični podatki:

\n

${ctx.get('route_exception').message}

\n
\n " +msgstr "" +"\n" +"
\n" +"

Pozdravljeni ${ctx.get('sender_message').get('from')}.

\n" +"

Z vašim e-poštnim sporočilom imamo težave: ${ctx.get('sender_message').get('subject')}

\n" +"

Ste mogoče uporabili napačen e-poštni naslov?

\n" +"


\n" +"

Tehnični podatki:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread @@ -39,7 +49,7 @@ msgid "Email Thread" msgstr "E-poštna nit" #. module: fetchmail_notify_error_to_sender -#: field:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "Error notice template" msgstr "Predloga obvestila o napaki" @@ -49,13 +59,15 @@ msgid "POP/IMAP Server" msgstr "POP/IMAP strežnik" #. module: fetchmail_notify_error_to_sender -#: model:email.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}" msgstr "Napaka pri prejemu: ${ctx.get('sender_message').get('subject')|safe}" #. module: fetchmail_notify_error_to_sender -#: help:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" -msgstr "Nastavite predlogo, ki bo uporabljena za pošiljanje obvestila pošiljatelju, kadar se bi pojavile napake pri prejemu e-pošte" +msgstr "" +"Nastavite predlogo, ki bo uporabljena za pošiljanje obvestila pošiljatelju, " +"kadar se bi pojavile napake pri prejemu e-pošte" diff --git a/fetchmail_notify_error_to_sender/i18n/tr.po b/fetchmail_notify_error_to_sender/i18n/tr.po index 09a8e6c41a8..b27161e9b06 100644 --- a/fetchmail_notify_error_to_sender/i18n/tr.po +++ b/fetchmail_notify_error_to_sender/i18n/tr.po @@ -3,15 +3,15 @@ # * fetchmail_notify_error_to_sender # # Translators: -# Ahmet Altınışık , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-19 14:44+0000\n" -"PO-Revision-Date: 2016-01-31 13:32+0000\n" -"Last-Translator: Ahmet Altınışık \n" -"Language-Team: Turkish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/tr/)\n" +"POT-Creation-Date: 2017-07-15 02:48+0000\n" +"PO-Revision-Date: 2017-07-15 02:48+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: fetchmail_notify_error_to_sender -#: model:email.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 "" "\n" "
\n" @@ -31,7 +31,17 @@ msgid "" "

${ctx.get('route_exception').message}

\n" "
\n" " " -msgstr "\n
\n

Merhaba ${ctx.get('sender_message').get('from')},

\n

E-postanız ile ilgili bir problem var: ${ctx.get('sender_message').get('subject')}

\n

Belki alıcı adresi yanlıştır?

\n


\n

Teknik detaylar:

\n

${ctx.get('route_exception').message}

\n
\n " +msgstr "" +"\n" +"
\n" +"

Merhaba ${ctx.get('sender_message').get('from')},

\n" +"

E-postanız ile ilgili bir problem var: ${ctx.get('sender_message').get('subject')}

\n" +"

Belki alıcı adresi yanlıştır?

\n" +"


\n" +"

Teknik detaylar:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread @@ -39,7 +49,7 @@ msgid "Email Thread" msgstr "Eposta konuşması" #. module: fetchmail_notify_error_to_sender -#: field:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "Error notice template" msgstr "Hata bildirim şablonu" @@ -49,13 +59,15 @@ msgid "POP/IMAP Server" msgstr "POP/IMAP sunucu" #. module: fetchmail_notify_error_to_sender -#: model:email.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}" msgstr "Alınan hata : ${ctx.get('sender_message').get('subject')|safe}" #. module: fetchmail_notify_error_to_sender -#: help:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" -msgstr "E-posta alınırken oluşan hatalarda gönderilecek bildirim mesajı için şablonu belirleyin." +msgstr "" +"E-posta alınırken oluşan hatalarda gönderilecek bildirim mesajı için şablonu" +" belirleyin." diff --git a/fetchmail_notify_error_to_sender/i18n/zh_CN.po b/fetchmail_notify_error_to_sender/i18n/zh_CN.po new file mode 100644 index 00000000000..ee8456c7933 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/zh_CN.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Jeffery CHEN , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-15 02:48+0000\n" +"PO-Revision-Date: 2017-07-15 02:48+0000\n" +"Last-Translator: Jeffery CHEN , 2017\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: zh_CN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: fetchmail_notify_error_to_sender +#: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id +msgid "Error notice template" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "POP/IMAP 服务器" + +#. module: fetchmail_notify_error_to_sender +#: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "" diff --git a/fetchmail_notify_error_to_sender/mail_thread.py b/fetchmail_notify_error_to_sender/mail_thread.py deleted file mode 100644 index 19eddcac482..00000000000 --- a/fetchmail_notify_error_to_sender/mail_thread.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Lorenzo Battistini -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp.osv import osv - - -class mail_thread(osv.AbstractModel): - _inherit = 'mail.thread' - - def message_route_verify( - self, cr, uid, message, message_dict, route, update_author=True, - assert_model=True, create_fallback=True, allow_private=False, - context=None - ): - res = () - if context is None: - context = {} - try: - res = super(mail_thread, self).message_route_verify( - cr, uid, message, message_dict, route, - update_author=update_author, assert_model=assert_model, - create_fallback=create_fallback, allow_private=allow_private, - context=context) - except ValueError as ve: - fetchmail_server_id = context.get('fetchmail_server_id') - if not fetchmail_server_id: - raise ve - fetchmail_server = self.pool['fetchmail.server'].browse( - cr, uid, fetchmail_server_id, context) - if not fetchmail_server.error_notice_template_id: - raise ve - context['sender_message'] = message - context['route_exception'] = ve - self.pool['email.template'].send_mail( - cr, uid, fetchmail_server.error_notice_template_id.id, - fetchmail_server.id, context=context) - context['error_notice_sent'] = True - return res - - def message_route( - self, cr, uid, message, message_dict, model=None, thread_id=None, - custom_values=None, context=None - ): - if context is None: - context = {} - res = [] - try: - res = super(mail_thread, self).message_route( - cr, uid, message, message_dict, model=model, - thread_id=thread_id, custom_values=custom_values, - context=context) - except ValueError as ve: - if context.get('error_notice_sent'): - # avoid raising exception and setting mail message UNSEEN - return [] - else: - raise ve - return res diff --git a/fetchmail_notify_error_to_sender/models/__init__.py b/fetchmail_notify_error_to_sender/models/__init__.py new file mode 100644 index 00000000000..e18df97721a --- /dev/null +++ b/fetchmail_notify_error_to_sender/models/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import fetchmail +from . import mail_thread diff --git a/fetchmail_notify_error_to_sender/models/fetchmail.py b/fetchmail_notify_error_to_sender/models/fetchmail.py new file mode 100644 index 00000000000..e7be9e1639d --- /dev/null +++ b/fetchmail_notify_error_to_sender/models/fetchmail.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 Lorenzo Battistini +# Copyright 2017 Eficent +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import fields, models + + +class FetchmailServer(models.Model): + + _inherit = 'fetchmail.server' + error_notice_template_id = fields.Many2one( + 'mail.template', string="Error notice template", + help="Set here the template to use to send notice to sender when " + "errors occur while fetching email") diff --git a/fetchmail_notify_error_to_sender/models/mail_thread.py b/fetchmail_notify_error_to_sender/models/mail_thread.py new file mode 100644 index 00000000000..6b3c0c7ca60 --- /dev/null +++ b/fetchmail_notify_error_to_sender/models/mail_thread.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 Lorenzo Battistini +# Copyright 2017 Eficent +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import api, models + + +class MailThread(models.AbstractModel): + _inherit = 'mail.thread' + + @api.model + def message_route_verify( + self, message, message_dict, route, update_author=True, + assert_model=True, create_fallback=True, allow_private=False): + res = () + try: + res = super(MailThread, self).message_route_verify( + message, message_dict, route, + update_author=update_author, assert_model=assert_model, + create_fallback=create_fallback, allow_private=allow_private) + except ValueError as ve: + fetchmail_server_id = self.env.context.get('fetchmail_server_id') + if not fetchmail_server_id: + raise ve + fetchmail_server = self.pool['fetchmail.server'].browse( + fetchmail_server_id) + if not fetchmail_server.error_notice_template_id: + raise ve + self.env.context['sender_message'] = message + self.env.context['route_exception'] = ve + self.env['mail.template'].send_mail( + fetchmail_server.error_notice_template_id.id, + fetchmail_server.id) + self.env.context['error_notice_sent'] = True + return res + + @api.model + def message_route( + self, message, message_dict, model=None, thread_id=None, + custom_values=None): + res = [] + try: + res = super(MailThread, self).message_route( + message, message_dict, model=model, + thread_id=thread_id, custom_values=custom_values) + except ValueError as ve: + if self.env.context.get('error_notice_sent'): + # avoid raising exception and setting mail message UNSEEN + return [] + else: + raise ve + return res diff --git a/fetchmail_notify_error_to_sender/fetchmail_view.xml b/fetchmail_notify_error_to_sender/views/fetchmail_view.xml similarity index 71% rename from fetchmail_notify_error_to_sender/fetchmail_view.xml rename to fetchmail_notify_error_to_sender/views/fetchmail_view.xml index c7223b29aea..b3fbcd8b1e1 100644 --- a/fetchmail_notify_error_to_sender/fetchmail_view.xml +++ b/fetchmail_notify_error_to_sender/views/fetchmail_view.xml @@ -1,16 +1,13 @@ - - - + fetchmail.server.form fetchmail.server - + - + - - + From bb4f9911c01d37bce19da8c7c795e88ed0b2d008 Mon Sep 17 00:00:00 2001 From: mreficent Date: Mon, 17 Jul 2017 12:43:39 +0200 Subject: [PATCH 04/29] [MIG] fetchmail_notify_error_to_sender: Migration to 10.0 --- fetchmail_notify_error_to_sender/README.rst | 8 ++++---- .../{__openerp__.py => __manifest__.py} | 4 ++-- .../data/email_template_data.xml | 6 ++---- fetchmail_notify_error_to_sender/models/fetchmail.py | 2 +- fetchmail_notify_error_to_sender/models/mail_thread.py | 2 +- fetchmail_notify_error_to_sender/views/fetchmail_view.xml | 2 +- 6 files changed, 11 insertions(+), 13 deletions(-) rename fetchmail_notify_error_to_sender/{__openerp__.py => __manifest__.py} (89%) diff --git a/fetchmail_notify_error_to_sender/README.rst b/fetchmail_notify_error_to_sender/README.rst index 813be264e12..2fa99caef61 100644 --- a/fetchmail_notify_error_to_sender/README.rst +++ b/fetchmail_notify_error_to_sender/README.rst @@ -2,9 +2,9 @@ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 -=============================== -Send notice on fetchmail errors -=============================== +================================ +Fetchmail Notify Error to Sender +================================ If fetchmail is not able to correctly route an email, the email is "silently" lost (you get an error message in server log). @@ -57,7 +57,7 @@ Contributors ------------ * Lorenzo Battistini -* Miquel Raïch (migration to v9) +* Miquel Raïch (migration to v9 and v10) Maintainer ---------- diff --git a/fetchmail_notify_error_to_sender/__openerp__.py b/fetchmail_notify_error_to_sender/__manifest__.py similarity index 89% rename from fetchmail_notify_error_to_sender/__openerp__.py rename to fetchmail_notify_error_to_sender/__manifest__.py index 97d87cbd01e..357519a651a 100644 --- a/fetchmail_notify_error_to_sender/__openerp__.py +++ b/fetchmail_notify_error_to_sender/__manifest__.py @@ -4,9 +4,9 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - 'name': 'Send notice on fetchmail errors', + 'name': 'Fetchmail Notify Error to Sender', 'summary': 'If fetching mails gives error, send an email to sender', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'category': 'Tools', 'author': "Agile Business Group,Eficent,Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/server-tools', diff --git a/fetchmail_notify_error_to_sender/data/email_template_data.xml b/fetchmail_notify_error_to_sender/data/email_template_data.xml index 3bfbb212d76..6e137150937 100644 --- a/fetchmail_notify_error_to_sender/data/email_template_data.xml +++ b/fetchmail_notify_error_to_sender/data/email_template_data.xml @@ -1,6 +1,5 @@ - - + Fetchmail - error notice @@ -22,5 +21,4 @@
]]> - - + diff --git a/fetchmail_notify_error_to_sender/models/fetchmail.py b/fetchmail_notify_error_to_sender/models/fetchmail.py index e7be9e1639d..3192cba5150 100644 --- a/fetchmail_notify_error_to_sender/models/fetchmail.py +++ b/fetchmail_notify_error_to_sender/models/fetchmail.py @@ -3,7 +3,7 @@ # Copyright 2017 Eficent # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import fields, models +from odoo import fields, models class FetchmailServer(models.Model): diff --git a/fetchmail_notify_error_to_sender/models/mail_thread.py b/fetchmail_notify_error_to_sender/models/mail_thread.py index 6b3c0c7ca60..bbe78b70d18 100644 --- a/fetchmail_notify_error_to_sender/models/mail_thread.py +++ b/fetchmail_notify_error_to_sender/models/mail_thread.py @@ -3,7 +3,7 @@ # Copyright 2017 Eficent # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import api, models +from odoo import api, models class MailThread(models.AbstractModel): diff --git a/fetchmail_notify_error_to_sender/views/fetchmail_view.xml b/fetchmail_notify_error_to_sender/views/fetchmail_view.xml index b3fbcd8b1e1..39b2023c68f 100644 --- a/fetchmail_notify_error_to_sender/views/fetchmail_view.xml +++ b/fetchmail_notify_error_to_sender/views/fetchmail_view.xml @@ -3,7 +3,7 @@ fetchmail.server.form fetchmail.server - + From d495dc32a32b1190776fa96f292ea2c82adcdf46 Mon Sep 17 00:00:00 2001 From: eLBati Date: Thu, 13 Jul 2017 18:05:36 +0200 Subject: [PATCH 05/29] porting fetchmail_notify_error_to_sender to 10.0 --- fetchmail_notify_error_to_sender/i18n/de.po | 26 +++-------- fetchmail_notify_error_to_sender/i18n/it.po | 27 ++++++++--- .../i18n/pt_BR.po | 14 +++--- fetchmail_notify_error_to_sender/i18n/sl.po | 24 +++------- .../models/mail_thread.py | 45 +++++-------------- 5 files changed, 51 insertions(+), 85 deletions(-) diff --git a/fetchmail_notify_error_to_sender/i18n/de.po b/fetchmail_notify_error_to_sender/i18n/de.po index 1a9bbca95f4..4723282c1c7 100644 --- a/fetchmail_notify_error_to_sender/i18n/de.po +++ b/fetchmail_notify_error_to_sender/i18n/de.po @@ -6,10 +6,10 @@ # OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-15 02:48+0000\n" -"PO-Revision-Date: 2017-07-15 02:48+0000\n" +"POT-Creation-Date: 2017-12-01 02:10+0000\n" +"PO-Revision-Date: 2017-12-01 02:10+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "MIME-Version: 1.0\n" @@ -32,36 +32,26 @@ msgid "" "
\n" " " msgstr "" -"\n" -"
\n" -"

Hallo ${ctx.get('sender_message').get('from')},

\n" -"

wir haben ein Problem mit Ihrer Email: ${ctx.get('sender_message').get('subject')}

\n" -"

Vielleicht haben Sie nur die falsche Empfängeradresse angegeben?

\n" -"


\n" -"

Technische Details:

\n" -"

${ctx.get('route_exception').message}

\n" -"
\n" -" " #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread msgid "Email Thread" -msgstr "Email-Thread" +msgstr "" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "Error notice template" -msgstr "Fehlerhinweis-Vorlage" +msgstr "" #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server msgid "POP/IMAP Server" -msgstr "POP/IMAP Server" +msgstr "POP/IMAP-Server" #. module: fetchmail_notify_error_to_sender #: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" -msgstr "Erhalte Fehler mit: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id @@ -69,5 +59,3 @@ msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" msgstr "" -"Legen Sie hier die Vorlage fest, die verwendet werden soll, um Hinweise an " -"Benutzer zu senden, wenn Fehler beim Nachrichten Abholen auftreten." diff --git a/fetchmail_notify_error_to_sender/i18n/it.po b/fetchmail_notify_error_to_sender/i18n/it.po index cd3f6386a46..a96b9c6da3a 100644 --- a/fetchmail_notify_error_to_sender/i18n/it.po +++ b/fetchmail_notify_error_to_sender/i18n/it.po @@ -3,14 +3,14 @@ # * fetchmail_notify_error_to_sender # # Translators: -# OCA Transbot , 2017 +# Paolo Valier , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-15 02:48+0000\n" -"PO-Revision-Date: 2017-07-15 02:48+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"POT-Creation-Date: 2018-01-06 02:25+0000\n" +"PO-Revision-Date: 2018-01-06 02:25+0000\n" +"Last-Translator: Paolo Valier , 2018\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -32,16 +32,26 @@ msgid "" "
\n" " " msgstr "" +"\n" +"
\n" +"

Salve ${ctx.get('sender_message').get('from')},

\n" +"

abbiamo avuto un problema con la tua mail: ${ctx.get('sender_message').get('subject')}

\n" +"

Forse hai usato un indirizzo errato?

\n" +"


\n" +"

Dettagli tecnici:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread msgid "Email Thread" -msgstr "Discussione Email" +msgstr "Discussione Mail" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "Error notice template" -msgstr "Modello per il messaggio di errore" +msgstr "Template Notifica Errore" #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server @@ -52,6 +62,7 @@ msgstr "Server POP/IMAP" #: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" msgstr "" +"Ricezione errore con: ${ctx.get('sender_message').get('subject')|safe}" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id @@ -59,3 +70,5 @@ msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" msgstr "" +"Imposta qui il template da usare per inviare una notifica al mittente quando" +" si verificano errori durante il recupero dell'e-mail" diff --git a/fetchmail_notify_error_to_sender/i18n/pt_BR.po b/fetchmail_notify_error_to_sender/i18n/pt_BR.po index ab6b8200eed..01701fca690 100644 --- a/fetchmail_notify_error_to_sender/i18n/pt_BR.po +++ b/fetchmail_notify_error_to_sender/i18n/pt_BR.po @@ -6,10 +6,10 @@ # OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-15 02:48+0000\n" -"PO-Revision-Date: 2017-07-15 02:48+0000\n" +"POT-Creation-Date: 2017-12-01 02:10+0000\n" +"PO-Revision-Date: 2017-12-01 02:10+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" "MIME-Version: 1.0\n" @@ -36,12 +36,12 @@ msgstr "" #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread msgid "Email Thread" -msgstr "Processo Email" +msgstr "" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "Error notice template" -msgstr "Modelo de aviso de erro" +msgstr "" #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server @@ -51,7 +51,7 @@ msgstr "Servidor POP/IMAP" #. module: fetchmail_notify_error_to_sender #: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" -msgstr "Recebendo erro com: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id @@ -59,5 +59,3 @@ msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" msgstr "" -"Configure aqui o modelo para usar para enviar aviso ao remetente quando " -"ocorrer erro durante a carga de email" diff --git a/fetchmail_notify_error_to_sender/i18n/sl.po b/fetchmail_notify_error_to_sender/i18n/sl.po index 3368404c9cc..a6046bfbdf4 100644 --- a/fetchmail_notify_error_to_sender/i18n/sl.po +++ b/fetchmail_notify_error_to_sender/i18n/sl.po @@ -6,10 +6,10 @@ # OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-15 02:48+0000\n" -"PO-Revision-Date: 2017-07-15 02:48+0000\n" +"POT-Creation-Date: 2017-12-01 02:10+0000\n" +"PO-Revision-Date: 2017-12-01 02:10+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" "MIME-Version: 1.0\n" @@ -32,26 +32,16 @@ msgid "" "
\n" " " msgstr "" -"\n" -"
\n" -"

Pozdravljeni ${ctx.get('sender_message').get('from')}.

\n" -"

Z vašim e-poštnim sporočilom imamo težave: ${ctx.get('sender_message').get('subject')}

\n" -"

Ste mogoče uporabili napačen e-poštni naslov?

\n" -"


\n" -"

Tehnični podatki:

\n" -"

${ctx.get('route_exception').message}

\n" -"
\n" -" " #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread msgid "Email Thread" -msgstr "E-poštna nit" +msgstr "" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "Error notice template" -msgstr "Predloga obvestila o napaki" +msgstr "" #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server @@ -61,7 +51,7 @@ msgstr "POP/IMAP strežnik" #. module: fetchmail_notify_error_to_sender #: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" -msgstr "Napaka pri prejemu: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id @@ -69,5 +59,3 @@ msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" msgstr "" -"Nastavite predlogo, ki bo uporabljena za pošiljanje obvestila pošiljatelju, " -"kadar se bi pojavile napake pri prejemu e-pošte" diff --git a/fetchmail_notify_error_to_sender/models/mail_thread.py b/fetchmail_notify_error_to_sender/models/mail_thread.py index bbe78b70d18..d90a1908685 100644 --- a/fetchmail_notify_error_to_sender/models/mail_thread.py +++ b/fetchmail_notify_error_to_sender/models/mail_thread.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2015 Lorenzo Battistini +# Copyright 2015-2017 Lorenzo Battistini # Copyright 2017 Eficent # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -10,44 +10,23 @@ class MailThread(models.AbstractModel): _inherit = 'mail.thread' @api.model - def message_route_verify( - self, message, message_dict, route, update_author=True, - assert_model=True, create_fallback=True, allow_private=False): - res = () + def message_route(self, message, message_dict, model=None, thread_id=None, + custom_values=None): try: - res = super(MailThread, self).message_route_verify( - message, message_dict, route, - update_author=update_author, assert_model=assert_model, - create_fallback=create_fallback, allow_private=allow_private) + res = super(MailThread, self).message_route( + message, message_dict, model=model, thread_id=thread_id, + custom_values=custom_values) except ValueError as ve: fetchmail_server_id = self.env.context.get('fetchmail_server_id') if not fetchmail_server_id: raise ve - fetchmail_server = self.pool['fetchmail.server'].browse( - fetchmail_server_id) + fetchmail_server = self.env['fetchmail.server'].with_context({ + 'sender_message': message, + 'route_exception': ve, + }).browse(fetchmail_server_id) if not fetchmail_server.error_notice_template_id: raise ve - self.env.context['sender_message'] = message - self.env.context['route_exception'] = ve - self.env['mail.template'].send_mail( - fetchmail_server.error_notice_template_id.id, + fetchmail_server.error_notice_template_id.send_mail( fetchmail_server.id) - self.env.context['error_notice_sent'] = True - return res - - @api.model - def message_route( - self, message, message_dict, model=None, thread_id=None, - custom_values=None): - res = [] - try: - res = super(MailThread, self).message_route( - message, message_dict, model=model, - thread_id=thread_id, custom_values=custom_values) - except ValueError as ve: - if self.env.context.get('error_notice_sent'): - # avoid raising exception and setting mail message UNSEEN - return [] - else: - raise ve + raise ve return res From 572588574adbed190f6b2c2e09918c7f184f638c Mon Sep 17 00:00:00 2001 From: HaiDD Date: Tue, 1 May 2018 16:15:52 +0700 Subject: [PATCH 06/29] [MIG] fetchmail_notify_error_to_sender: Migration to 11.0 --- fetchmail_notify_error_to_sender/README.rst | 3 +- fetchmail_notify_error_to_sender/__init__.py | 3 -- .../__manifest__.py | 7 ++-- .../data/email_template_data.xml | 42 +++++++++---------- .../models/__init__.py | 2 - .../models/fetchmail.py | 4 +- .../models/mail_thread.py | 2 +- .../views/fetchmail_view.xml | 18 ++++---- 8 files changed, 39 insertions(+), 42 deletions(-) diff --git a/fetchmail_notify_error_to_sender/README.rst b/fetchmail_notify_error_to_sender/README.rst index 2fa99caef61..3f27c836b78 100644 --- a/fetchmail_notify_error_to_sender/README.rst +++ b/fetchmail_notify_error_to_sender/README.rst @@ -35,7 +35,7 @@ Usage .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :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 =========== @@ -58,6 +58,7 @@ Contributors * Lorenzo Battistini * Miquel Raïch (migration to v9 and v10) +* Hai Dinh (migration to V11) Maintainer ---------- diff --git a/fetchmail_notify_error_to_sender/__init__.py b/fetchmail_notify_error_to_sender/__init__.py index 226b25b5f3e..69f7babdfb1 100644 --- a/fetchmail_notify_error_to_sender/__init__.py +++ b/fetchmail_notify_error_to_sender/__init__.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -# Copyright 2015 Lorenzo Battistini -# Copyright 2017 Eficent # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models diff --git a/fetchmail_notify_error_to_sender/__manifest__.py b/fetchmail_notify_error_to_sender/__manifest__.py index 357519a651a..41d01ee055c 100644 --- a/fetchmail_notify_error_to_sender/__manifest__.py +++ b/fetchmail_notify_error_to_sender/__manifest__.py @@ -1,14 +1,15 @@ -# -*- coding: utf-8 -*- # Copyright 2015 Lorenzo Battistini # Copyright 2017 Eficent +# Copyright 2018 Hai Dinh # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Fetchmail Notify Error 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', - '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', 'license': 'AGPL-3', 'depends': [ diff --git a/fetchmail_notify_error_to_sender/data/email_template_data.xml b/fetchmail_notify_error_to_sender/data/email_template_data.xml index 6e137150937..2a90fad4b3f 100644 --- a/fetchmail_notify_error_to_sender/data/email_template_data.xml +++ b/fetchmail_notify_error_to_sender/data/email_template_data.xml @@ -1,24 +1,24 @@ - - - Fetchmail - error notice - ${ctx.get('sender_message').get('to')|safe} - ${ctx.get('sender_message').get('from')|safe} - Receiving error with: ${ctx.get('sender_message').get('subject')|safe} - - - - ${ctx.get('lang')} - -

Hello ${ctx.get('sender_message').get('from')},

-

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

-

Maybe you used a wrong recipient address?

-


-

Technical details:

-

${ctx.get('route_exception').message}

- - ]]>
-
+ + + Fetchmail - error notice + ${ctx.get('sender_message').get('to')|safe} + ${ctx.get('sender_message').get('from')|safe} + Receiving error with: ${ctx.get('sender_message').get('subject')|safe} + + + + ${ctx.get('lang')} + +

Hello ${ctx.get('sender_message').get('from')},

+

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

+

Maybe you used a wrong recipient address?

+


+

Technical details:

+

${ctx.get('route_exception').message}

+ + ]]>
+
diff --git a/fetchmail_notify_error_to_sender/models/__init__.py b/fetchmail_notify_error_to_sender/models/__init__.py index e18df97721a..33189fb898f 100644 --- a/fetchmail_notify_error_to_sender/models/__init__.py +++ b/fetchmail_notify_error_to_sender/models/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# Copyright 2017 Eficent # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import fetchmail diff --git a/fetchmail_notify_error_to_sender/models/fetchmail.py b/fetchmail_notify_error_to_sender/models/fetchmail.py index 3192cba5150..2becf8f2ed2 100644 --- a/fetchmail_notify_error_to_sender/models/fetchmail.py +++ b/fetchmail_notify_error_to_sender/models/fetchmail.py @@ -1,14 +1,14 @@ -# -*- coding: utf-8 -*- # Copyright 2015 Lorenzo Battistini # Copyright 2017 Eficent +# Copyright 2018 Hai Dinh # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models class FetchmailServer(models.Model): - _inherit = 'fetchmail.server' + error_notice_template_id = fields.Many2one( 'mail.template', string="Error notice template", help="Set here the template to use to send notice to sender when " diff --git a/fetchmail_notify_error_to_sender/models/mail_thread.py b/fetchmail_notify_error_to_sender/models/mail_thread.py index d90a1908685..1ab797fc220 100644 --- a/fetchmail_notify_error_to_sender/models/mail_thread.py +++ b/fetchmail_notify_error_to_sender/models/mail_thread.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2017 Lorenzo Battistini # Copyright 2017 Eficent +# Copyright 2018 Hai Dinh # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, models diff --git a/fetchmail_notify_error_to_sender/views/fetchmail_view.xml b/fetchmail_notify_error_to_sender/views/fetchmail_view.xml index 39b2023c68f..40d7ba9f485 100644 --- a/fetchmail_notify_error_to_sender/views/fetchmail_view.xml +++ b/fetchmail_notify_error_to_sender/views/fetchmail_view.xml @@ -1,13 +1,13 @@ - - fetchmail.server.form - fetchmail.server - - - - - + + fetchmail.server.form + fetchmail.server + + + + - + + From 1aa2f11b7f77b383624cc43d8de07bd5b3aa3f83 Mon Sep 17 00:00:00 2001 From: Nedas Date: Tue, 3 Jul 2018 22:01:45 +0300 Subject: [PATCH 07/29] [11.0] [MIG] [fetchmail_notify_error_to_sender] - readme, tests, fix template tech. msg issue --- fetchmail_notify_error_to_sender/README.rst | 74 +-- .../data/email_template_data.xml | 2 +- fetchmail_notify_error_to_sender/i18n/ca.po | 23 +- fetchmail_notify_error_to_sender/i18n/de.po | 23 +- fetchmail_notify_error_to_sender/i18n/es.po | 34 +- .../i18n/fetchmail_notify_error_to_sender.pot | 54 +++ fetchmail_notify_error_to_sender/i18n/fr.po | 27 +- fetchmail_notify_error_to_sender/i18n/hr.po | 26 +- fetchmail_notify_error_to_sender/i18n/it.po | 34 +- .../i18n/pt_BR.po | 26 +- .../i18n/pt_PT.po | 30 +- fetchmail_notify_error_to_sender/i18n/sl.po | 26 +- fetchmail_notify_error_to_sender/i18n/tr.po | 31 +- .../i18n/zh_CN.po | 26 +- .../readme/CONFIGURE.rst | 4 + .../readme/CONTRIBUTORS.rst | 4 + .../readme/DESCRIPTION.rst | 10 + .../static/description/index.html | 439 ++++++++++++++++++ .../tests/__init__.py | 3 + .../test_fetchmail_notify_error_to_sender.py | 78 ++++ 20 files changed, 809 insertions(+), 165 deletions(-) create mode 100644 fetchmail_notify_error_to_sender/i18n/fetchmail_notify_error_to_sender.pot create mode 100644 fetchmail_notify_error_to_sender/readme/CONFIGURE.rst create mode 100644 fetchmail_notify_error_to_sender/readme/CONTRIBUTORS.rst create mode 100644 fetchmail_notify_error_to_sender/readme/DESCRIPTION.rst create mode 100644 fetchmail_notify_error_to_sender/static/description/index.html create mode 100644 fetchmail_notify_error_to_sender/tests/__init__.py create mode 100644 fetchmail_notify_error_to_sender/tests/test_fetchmail_notify_error_to_sender.py diff --git a/fetchmail_notify_error_to_sender/README.rst b/fetchmail_notify_error_to_sender/README.rst index 3f27c836b78..be501aa935f 100644 --- a/fetchmail_notify_error_to_sender/README.rst +++ b/fetchmail_notify_error_to_sender/README.rst @@ -1,11 +1,30 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ================================ Fetchmail Notify Error to Sender ================================ +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github + :target: https://github.com/OCA/server-tools/tree/11.0/fetchmail_notify_error_to_sender + :alt: OCA/server-tools +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/server-tools-11-0/server-tools-11-0-fetchmail_notify_error_to_sender + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/149/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + If fetchmail is not able to correctly route an email, the email is "silently" lost (you get an error message in server log). @@ -17,6 +36,10 @@ This module extends the functionality of fetchmail to allow you to automatically send a notification email to sender, when odoo can't correctly process the received email. +**Table of contents** + +.. contents:: + :local: Configuration ============= @@ -26,51 +49,46 @@ To configure this module, you need to: #. Configure your fetchmail server setting 'Error notice template' = 'Fetchmail - error notice'. #. You can edit the 'Fetchmail - error notice' email template according to your needs. -.. figure:: path/to/local/image.png - :alt: alternative description - :width: 600 px - -Usage -===== - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/149/11.0 - Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smash it by providing detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* Agile Business Group +* Eficent Contributors ------------- +~~~~~~~~~~~~ * Lorenzo Battistini * Miquel Raïch (migration to v9 and v10) * Hai Dinh (migration to V11) +* Nedas Zilinskas (Ventor, Xpansa Group ) + +Maintainers +~~~~~~~~~~~ -Maintainer ----------- +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file +This module is part of the `OCA/server-tools `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fetchmail_notify_error_to_sender/data/email_template_data.xml b/fetchmail_notify_error_to_sender/data/email_template_data.xml index 2a90fad4b3f..d85ba35c758 100644 --- a/fetchmail_notify_error_to_sender/data/email_template_data.xml +++ b/fetchmail_notify_error_to_sender/data/email_template_data.xml @@ -17,7 +17,7 @@

Maybe you used a wrong recipient address?


Technical details:

-

${ctx.get('route_exception').message}

+

${ctx.get('route_exception')}

]]>
diff --git a/fetchmail_notify_error_to_sender/i18n/ca.po b/fetchmail_notify_error_to_sender/i18n/ca.po index b197c79aa57..8dd65f68d97 100644 --- a/fetchmail_notify_error_to_sender/i18n/ca.po +++ b/fetchmail_notify_error_to_sender/i18n/ca.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * fetchmail_notify_error_to_sender -# +# # Translators: # Marc Tormo i Bochaca , 2017 msgid "" @@ -12,25 +12,26 @@ msgstr "" "PO-Revision-Date: 2017-07-15 02:48+0000\n" "Last-Translator: Marc Tormo i Bochaca , 2017\n" "Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: ca\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice msgid "" "\n" -"
\n" -"

Hello ${ctx.get('sender_message').get('from')},

\n" -"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" -"

Maybe you used a wrong recipient address?

\n" -"


\n" -"

Technical details:

\n" -"

${ctx.get('route_exception').message}

\n" -"
\n" -" " +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx." +"get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception')}

\n" +"
\n" +" " msgstr "" #. module: fetchmail_notify_error_to_sender diff --git a/fetchmail_notify_error_to_sender/i18n/de.po b/fetchmail_notify_error_to_sender/i18n/de.po index 4723282c1c7..0aad357f2ec 100644 --- a/fetchmail_notify_error_to_sender/i18n/de.po +++ b/fetchmail_notify_error_to_sender/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * fetchmail_notify_error_to_sender -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,25 +12,26 @@ msgstr "" "PO-Revision-Date: 2017-12-01 02:10+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice msgid "" "\n" -"
\n" -"

Hello ${ctx.get('sender_message').get('from')},

\n" -"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" -"

Maybe you used a wrong recipient address?

\n" -"


\n" -"

Technical details:

\n" -"

${ctx.get('route_exception').message}

\n" -"
\n" -" " +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx." +"get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception')}

\n" +"
\n" +" " msgstr "" #. module: fetchmail_notify_error_to_sender diff --git a/fetchmail_notify_error_to_sender/i18n/es.po b/fetchmail_notify_error_to_sender/i18n/es.po index e73ea6f16ee..2bf299d00e6 100644 --- a/fetchmail_notify_error_to_sender/i18n/es.po +++ b/fetchmail_notify_error_to_sender/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * fetchmail_notify_error_to_sender -# +# # Translators: # Ahmet Altınışık , 2016 # Antonio Trueba, 2016 @@ -40,27 +40,41 @@ msgstr "" "POT-Creation-Date: 2016-04-14 07:02+0000\n" "PO-Revision-Date: 2016-04-07 17:54+0000\n" "Last-Translator: Antonio Trueba\n" -"Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/es/)\n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-8-0/" +"language/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +#, fuzzy msgid "" "\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx." +"get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception')}

\n" +"
\n" +" " +msgstr "" +"\n" "
\n" -"

Hello ${ctx.get('sender_message').get('from')},

\n" -"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" -"

Maybe you used a wrong recipient address?

\n" +"

Hola ${ctx.get('sender_message').get('from')},

\n" +"

tenemos un problema con su email: ${ctx.get('sender_message')." +"get('subject')}

\n" +"

¿Puede haber usado una dirección de destino incorrecta?

\n" "


\n" -"

Technical details:

\n" +"

Detalles técnicos:

\n" "

${ctx.get('route_exception').message}

\n" "
\n" " " -msgstr "\n
\n

Hola ${ctx.get('sender_message').get('from')},

\n

tenemos un problema con su email: ${ctx.get('sender_message').get('subject')}

\n

¿Puede haber usado una dirección de destino incorrecta?

\n


\n

Detalles técnicos:

\n

${ctx.get('route_exception').message}

\n
\n " #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread @@ -68,7 +82,7 @@ msgid "Email Thread" msgstr "Hilo correo electrónico" #. module: fetchmail_notify_error_to_sender -#: field:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "Error notice template" msgstr "" @@ -83,7 +97,7 @@ msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" msgstr "" #. module: fetchmail_notify_error_to_sender -#: help:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" diff --git a/fetchmail_notify_error_to_sender/i18n/fetchmail_notify_error_to_sender.pot b/fetchmail_notify_error_to_sender/i18n/fetchmail_notify_error_to_sender.pot new file mode 100644 index 00000000000..acce4e95a8c --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/fetchmail_notify_error_to_sender.pot @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: fetchmail_notify_error_to_sender +#: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception')}

\n" +"
\n" +" " +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id +msgid "Error notice template" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id +msgid "Set here the template to use to send notice to sender when errors occur while fetching email" +msgstr "" + diff --git a/fetchmail_notify_error_to_sender/i18n/fr.po b/fetchmail_notify_error_to_sender/i18n/fr.po index 1af7b0bf479..bff5d878904 100644 --- a/fetchmail_notify_error_to_sender/i18n/fr.po +++ b/fetchmail_notify_error_to_sender/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * fetchmail_notify_error_to_sender -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,30 +12,33 @@ msgstr "" "PO-Revision-Date: 2017-07-15 02:48+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +#, fuzzy msgid "" "\n" -"
\n" -"

Hello ${ctx.get('sender_message').get('from')},

\n" -"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" -"

Maybe you used a wrong recipient address?

\n" -"


\n" -"

Technical details:

\n" -"

${ctx.get('route_exception').message}

\n" -"
\n" -" " +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx." +"get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception')}

\n" +"
\n" +" " msgstr "" "\n" "
\n" "

Bonjour ${ctx.get('sender_message').get('from')},

\n" -"

nous avons de la difficulté avec votre adresse de courriel: ${ctx.get('sender_message').get('subject')}

\n" +"

nous avons de la difficulté avec votre adresse de courriel: ${ctx." +"get('sender_message').get('subject')}

\n" "

Peut-être avez-vous utilisé une mauvaise adresse de destinataire?

\n" "


\n" "

Détails techniques:

\n" diff --git a/fetchmail_notify_error_to_sender/i18n/hr.po b/fetchmail_notify_error_to_sender/i18n/hr.po index e0dd9bad54c..a5f8449931c 100644 --- a/fetchmail_notify_error_to_sender/i18n/hr.po +++ b/fetchmail_notify_error_to_sender/i18n/hr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * fetchmail_notify_error_to_sender -# +# # Translators: # Bole , 2017 msgid "" @@ -12,25 +12,27 @@ msgstr "" "PO-Revision-Date: 2017-07-15 02:48+0000\n" "Last-Translator: Bole , 2017\n" "Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice msgid "" "\n" -"
\n" -"

Hello ${ctx.get('sender_message').get('from')},

\n" -"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" -"

Maybe you used a wrong recipient address?

\n" -"


\n" -"

Technical details:

\n" -"

${ctx.get('route_exception').message}

\n" -"
\n" -" " +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx." +"get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception')}

\n" +"
\n" +" " msgstr "" #. module: fetchmail_notify_error_to_sender diff --git a/fetchmail_notify_error_to_sender/i18n/it.po b/fetchmail_notify_error_to_sender/i18n/it.po index a96b9c6da3a..88c083c4a88 100644 --- a/fetchmail_notify_error_to_sender/i18n/it.po +++ b/fetchmail_notify_error_to_sender/i18n/it.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * fetchmail_notify_error_to_sender -# +# # Translators: # Paolo Valier , 2018 msgid "" @@ -12,30 +12,33 @@ msgstr "" "PO-Revision-Date: 2018-01-06 02:25+0000\n" "Last-Translator: Paolo Valier , 2018\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +#, fuzzy msgid "" "\n" -"
\n" -"

Hello ${ctx.get('sender_message').get('from')},

\n" -"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" -"

Maybe you used a wrong recipient address?

\n" -"


\n" -"

Technical details:

\n" -"

${ctx.get('route_exception').message}

\n" -"
\n" -" " +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx." +"get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception')}

\n" +"
\n" +" " msgstr "" "\n" "
\n" "

Salve ${ctx.get('sender_message').get('from')},

\n" -"

abbiamo avuto un problema con la tua mail: ${ctx.get('sender_message').get('subject')}

\n" +"

abbiamo avuto un problema con la tua mail: ${ctx." +"get('sender_message').get('subject')}

\n" "

Forse hai usato un indirizzo errato?

\n" "


\n" "

Dettagli tecnici:

\n" @@ -61,8 +64,7 @@ msgstr "Server POP/IMAP" #. module: fetchmail_notify_error_to_sender #: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" -msgstr "" -"Ricezione errore con: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "Ricezione errore con: ${ctx.get('sender_message').get('subject')|safe}" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id @@ -70,5 +72,5 @@ msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" msgstr "" -"Imposta qui il template da usare per inviare una notifica al mittente quando" -" si verificano errori durante il recupero dell'e-mail" +"Imposta qui il template da usare per inviare una notifica al mittente quando " +"si verificano errori durante il recupero dell'e-mail" diff --git a/fetchmail_notify_error_to_sender/i18n/pt_BR.po b/fetchmail_notify_error_to_sender/i18n/pt_BR.po index 01701fca690..59064450579 100644 --- a/fetchmail_notify_error_to_sender/i18n/pt_BR.po +++ b/fetchmail_notify_error_to_sender/i18n/pt_BR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * fetchmail_notify_error_to_sender -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,26 +11,28 @@ msgstr "" "POT-Creation-Date: 2017-12-01 02:10+0000\n" "PO-Revision-Date: 2017-12-01 02:10+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice msgid "" "\n" -"
\n" -"

Hello ${ctx.get('sender_message').get('from')},

\n" -"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" -"

Maybe you used a wrong recipient address?

\n" -"


\n" -"

Technical details:

\n" -"

${ctx.get('route_exception').message}

\n" -"
\n" -" " +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx." +"get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception')}

\n" +"
\n" +" " msgstr "" #. module: fetchmail_notify_error_to_sender diff --git a/fetchmail_notify_error_to_sender/i18n/pt_PT.po b/fetchmail_notify_error_to_sender/i18n/pt_PT.po index 2b9a8719da2..c0d4280662f 100644 --- a/fetchmail_notify_error_to_sender/i18n/pt_PT.po +++ b/fetchmail_notify_error_to_sender/i18n/pt_PT.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * fetchmail_notify_error_to_sender -# +# # Translators: msgid "" msgstr "" @@ -10,26 +10,28 @@ msgstr "" "POT-Creation-Date: 2016-09-16 09:29+0000\n" "PO-Revision-Date: 2015-09-18 13:55+0000\n" "Last-Translator: <>\n" -"Language-Team: Portuguese (Portugal) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/pt_PT/)\n" +"Language-Team: Portuguese (Portugal) (http://www.transifex.com/oca/OCA-" +"server-tools-8-0/language/pt_PT/)\n" +"Language: pt_PT\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_PT\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice msgid "" "\n" -"
\n" -"

Hello ${ctx.get('sender_message').get('from')},

\n" -"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" -"

Maybe you used a wrong recipient address?

\n" -"


\n" -"

Technical details:

\n" -"

${ctx.get('route_exception').message}

\n" -"
\n" -" " +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx." +"get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception')}

\n" +"
\n" +" " msgstr "" #. module: fetchmail_notify_error_to_sender @@ -38,7 +40,7 @@ msgid "Email Thread" msgstr "Tópico de Email" #. module: fetchmail_notify_error_to_sender -#: field:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "Error notice template" msgstr "" @@ -53,7 +55,7 @@ msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" msgstr "" #. module: fetchmail_notify_error_to_sender -#: help:fetchmail.server,error_notice_template_id:0 +#: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server_error_notice_template_id msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" diff --git a/fetchmail_notify_error_to_sender/i18n/sl.po b/fetchmail_notify_error_to_sender/i18n/sl.po index a6046bfbdf4..ab29add9f0c 100644 --- a/fetchmail_notify_error_to_sender/i18n/sl.po +++ b/fetchmail_notify_error_to_sender/i18n/sl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * fetchmail_notify_error_to_sender -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,25 +12,27 @@ msgstr "" "PO-Revision-Date: 2017-12-01 02:10+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice msgid "" "\n" -"
\n" -"

Hello ${ctx.get('sender_message').get('from')},

\n" -"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" -"

Maybe you used a wrong recipient address?

\n" -"


\n" -"

Technical details:

\n" -"

${ctx.get('route_exception').message}

\n" -"
\n" -" " +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx." +"get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception')}

\n" +"
\n" +" " msgstr "" #. module: fetchmail_notify_error_to_sender diff --git a/fetchmail_notify_error_to_sender/i18n/tr.po b/fetchmail_notify_error_to_sender/i18n/tr.po index b27161e9b06..ffaa7b0dbd6 100644 --- a/fetchmail_notify_error_to_sender/i18n/tr.po +++ b/fetchmail_notify_error_to_sender/i18n/tr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * fetchmail_notify_error_to_sender -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,30 +12,33 @@ msgstr "" "PO-Revision-Date: 2017-07-15 02:48+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +#, fuzzy msgid "" "\n" -"
\n" -"

Hello ${ctx.get('sender_message').get('from')},

\n" -"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" -"

Maybe you used a wrong recipient address?

\n" -"


\n" -"

Technical details:

\n" -"

${ctx.get('route_exception').message}

\n" -"
\n" -" " +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx." +"get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception')}

\n" +"
\n" +" " msgstr "" "\n" "
\n" "

Merhaba ${ctx.get('sender_message').get('from')},

\n" -"

E-postanız ile ilgili bir problem var: ${ctx.get('sender_message').get('subject')}

\n" +"

E-postanız ile ilgili bir problem var: ${ctx.get('sender_message')." +"get('subject')}

\n" "

Belki alıcı adresi yanlıştır?

\n" "


\n" "

Teknik detaylar:

\n" @@ -69,5 +72,5 @@ msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" msgstr "" -"E-posta alınırken oluşan hatalarda gönderilecek bildirim mesajı için şablonu" -" belirleyin." +"E-posta alınırken oluşan hatalarda gönderilecek bildirim mesajı için şablonu " +"belirleyin." diff --git a/fetchmail_notify_error_to_sender/i18n/zh_CN.po b/fetchmail_notify_error_to_sender/i18n/zh_CN.po index ee8456c7933..aea4420f24c 100644 --- a/fetchmail_notify_error_to_sender/i18n/zh_CN.po +++ b/fetchmail_notify_error_to_sender/i18n/zh_CN.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * fetchmail_notify_error_to_sender -# +# # Translators: # Jeffery CHEN , 2017 msgid "" @@ -11,26 +11,28 @@ msgstr "" "POT-Creation-Date: 2017-07-15 02:48+0000\n" "PO-Revision-Date: 2017-07-15 02:48+0000\n" "Last-Translator: Jeffery CHEN , 2017\n" -"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/" +"zh_CN/)\n" +"Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice msgid "" "\n" -"
\n" -"

Hello ${ctx.get('sender_message').get('from')},

\n" -"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" -"

Maybe you used a wrong recipient address?

\n" -"


\n" -"

Technical details:

\n" -"

${ctx.get('route_exception').message}

\n" -"
\n" -" " +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx." +"get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception')}

\n" +"
\n" +" " msgstr "" #. module: fetchmail_notify_error_to_sender diff --git a/fetchmail_notify_error_to_sender/readme/CONFIGURE.rst b/fetchmail_notify_error_to_sender/readme/CONFIGURE.rst new file mode 100644 index 00000000000..bffe75f5ea8 --- /dev/null +++ b/fetchmail_notify_error_to_sender/readme/CONFIGURE.rst @@ -0,0 +1,4 @@ +To configure this module, you need to: + +#. Configure your fetchmail server setting 'Error notice template' = 'Fetchmail - error notice'. +#. You can edit the 'Fetchmail - error notice' email template according to your needs. diff --git a/fetchmail_notify_error_to_sender/readme/CONTRIBUTORS.rst b/fetchmail_notify_error_to_sender/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..62bb4ffa9ac --- /dev/null +++ b/fetchmail_notify_error_to_sender/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Lorenzo Battistini +* Miquel Raïch (migration to v9 and v10) +* Hai Dinh (migration to V11) +* Nedas Zilinskas (Ventor, Xpansa Group ) diff --git a/fetchmail_notify_error_to_sender/readme/DESCRIPTION.rst b/fetchmail_notify_error_to_sender/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..b2aed0cd4e3 --- /dev/null +++ b/fetchmail_notify_error_to_sender/readme/DESCRIPTION.rst @@ -0,0 +1,10 @@ +If fetchmail is not able to correctly route an email, the email is +"silently" lost (you get an error message in server log). + +For example, if you configure odoo mail system to route received emails +according to recipient address, it may happen users send emails to wrong +email address. + +This module extends the functionality of fetchmail to allow you to +automatically send a notification email to sender, when odoo can't +correctly process the received email. diff --git a/fetchmail_notify_error_to_sender/static/description/index.html b/fetchmail_notify_error_to_sender/static/description/index.html new file mode 100644 index 00000000000..eab5ff76d4c --- /dev/null +++ b/fetchmail_notify_error_to_sender/static/description/index.html @@ -0,0 +1,439 @@ + + + + + + +Fetchmail Notify Error to Sender + + + +
+

Fetchmail Notify Error to Sender

+ + +

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runbot

+

If fetchmail is not able to correctly route an email, the email is +“silently” lost (you get an error message in server log).

+

For example, if you configure odoo mail system to route received emails +according to recipient address, it may happen users send emails to wrong +email address.

+

This module extends the functionality of fetchmail to allow you to +automatically send a notification email to sender, when odoo can’t +correctly process the received email.

+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to:

+
    +
  1. Configure your fetchmail server setting ‘Error notice template’ = ‘Fetchmail - error notice’.
  2. +
  3. You can edit the ‘Fetchmail - error notice’ email template according to your needs.
  4. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Agile Business Group
  • +
  • Eficent
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/server-tools project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/fetchmail_notify_error_to_sender/tests/__init__.py b/fetchmail_notify_error_to_sender/tests/__init__.py new file mode 100644 index 00000000000..f6a21396963 --- /dev/null +++ b/fetchmail_notify_error_to_sender/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_fetchmail_notify_error_to_sender diff --git a/fetchmail_notify_error_to_sender/tests/test_fetchmail_notify_error_to_sender.py b/fetchmail_notify_error_to_sender/tests/test_fetchmail_notify_error_to_sender.py new file mode 100644 index 00000000000..65ab0bf9a05 --- /dev/null +++ b/fetchmail_notify_error_to_sender/tests/test_fetchmail_notify_error_to_sender.py @@ -0,0 +1,78 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +import socket +from odoo.addons.mail.tests.common import TestMail +from odoo.addons.mail.tests.test_mail_gateway import MAIL_TEMPLATE +from odoo.tools import mute_logger + + +class TestFetchmailNotifyErrorToSender(TestMail): + + def setUp(self): + super(TestFetchmailNotifyErrorToSender, self).setUp() + + self.fetchmail_server = self.env['fetchmail.server'].create({ + 'name': 'Test Fetchmail Server', + 'type': 'imap', + 'error_notice_template_id': self.env.ref('%s.%s' % ( + 'fetchmail_notify_error_to_sender', + 'email_template_error_notice', + )).id + }) + + def format_and_process_with_context( + self, template, to_email='groups@example.com, other@gmail.com', + subject='Frogs', extra='', + email_from='Sylvie Lelitre ', + cc_email='', + msg_id='<1198923581.41972151344608186760.JavaMail@agrolait.com>', + model=None, target_model='mail.test', target_field='name', ctx=False, + ): + self.assertFalse(self.env[target_model].search([ + (target_field, '=', subject), + ])) + mail = template.format( + to=to_email, + subject=subject, + cc=cc_email, + extra=extra, + email_from=email_from, + msg_id=msg_id, + ) + self.env['mail.thread'].with_context(ctx or {}).message_process( + model, + mail, + ) + return self.env[target_model].search([(target_field, '=', subject)]) + + @mute_logger('odoo.addons.mail.models.mail_thread', 'odoo.models') + def test_message_process(self): + email_from = 'valid.lelitre@agrolait.com' + + count_return_mails_before = self.env['mail.mail'].search_count([ + ('email_to', '=', email_from), + ]) + + with self.assertRaises(ValueError): + self.format_and_process_with_context( + MAIL_TEMPLATE, + email_from=email_from, + to_email='noone@example.com', + subject='spam', + extra='In-Reply-To: <12321321-openerp-%d-mail.test@%s>' % ( + self.test_public.id, + socket.gethostname(), + ), + ctx={ + 'fetchmail_server_id': self.fetchmail_server.id, + } + ) + + count_return_mails_after = self.env['mail.mail'].search_count([ + ('email_to', '=', email_from), + ]) + self.assertEqual( + count_return_mails_after, + count_return_mails_before + 1, + ) From 049976c25e1e91510633723401e21110582c5fe7 Mon Sep 17 00:00:00 2001 From: hveficent Date: Mon, 21 Jan 2019 15:45:00 +0100 Subject: [PATCH 08/29] [MIG] fetchmail_notify_error_to_sender: Migration to 12.0 --- fetchmail_notify_error_to_sender/README.rst | 10 +++++----- fetchmail_notify_error_to_sender/__manifest__.py | 2 +- .../static/description/index.html | 8 ++++---- .../tests/test_fetchmail_notify_error_to_sender.py | 11 ++++++----- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/fetchmail_notify_error_to_sender/README.rst b/fetchmail_notify_error_to_sender/README.rst index be501aa935f..a83bfea578d 100644 --- a/fetchmail_notify_error_to_sender/README.rst +++ b/fetchmail_notify_error_to_sender/README.rst @@ -14,13 +14,13 @@ Fetchmail Notify Error to Sender :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github - :target: https://github.com/OCA/server-tools/tree/11.0/fetchmail_notify_error_to_sender + :target: https://github.com/OCA/server-tools/tree/12.0/fetchmail_notify_error_to_sender :alt: OCA/server-tools .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-tools-11-0/server-tools-11-0-fetchmail_notify_error_to_sender + :target: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-fetchmail_notify_error_to_sender :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/149/11.0 + :target: https://runbot.odoo-community.org/runbot/149/12.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -55,7 +55,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -89,6 +89,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/server-tools `_ project on GitHub. +This module is part of the `OCA/server-tools `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fetchmail_notify_error_to_sender/__manifest__.py b/fetchmail_notify_error_to_sender/__manifest__.py index 41d01ee055c..6760adafede 100644 --- a/fetchmail_notify_error_to_sender/__manifest__.py +++ b/fetchmail_notify_error_to_sender/__manifest__.py @@ -6,7 +6,7 @@ { 'name': 'Fetchmail Notify Error to Sender', 'summary': 'If fetching mails gives error, send an email to sender', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'category': 'Tools', 'author': "Agile Business Group,Eficent,Odoo Community Association (OCA)", diff --git a/fetchmail_notify_error_to_sender/static/description/index.html b/fetchmail_notify_error_to_sender/static/description/index.html index eab5ff76d4c..9ea7c043770 100644 --- a/fetchmail_notify_error_to_sender/static/description/index.html +++ b/fetchmail_notify_error_to_sender/static/description/index.html @@ -3,7 +3,7 @@ - + Fetchmail Notify Error to Sender -
-

Fetchmail Notify Error to Sender

+
+ + +Odoo Community Association + +
+

Fetchmail Notify Error to Sender

-

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

If fetchmail is not able to correctly route an email, the email is “silently” lost (you get an error message in server log).

For example, if you configure odoo mail system to route received emails @@ -392,7 +397,7 @@

Fetchmail Notify Error to Sender

-

Configuration

+

Configuration

To configure this module, you need to:

  1. Configure your fetchmail server setting ‘Error notice template’ = @@ -402,7 +407,7 @@

    Configuration

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -410,16 +415,16 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Agile Business Group
  • ForgeFlow
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -445,5 +450,6 @@

Maintainers

+
diff --git a/fetchmail_notify_error_to_sender/tests/__init__.py b/fetchmail_notify_error_to_sender/tests/__init__.py new file mode 100644 index 00000000000..e64f3ecd064 --- /dev/null +++ b/fetchmail_notify_error_to_sender/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import test_fetchmail_notify_error_to_sender diff --git a/fetchmail_notify_error_to_sender/tests/test_fetchmail_notify_error_to_sender.py b/fetchmail_notify_error_to_sender/tests/test_fetchmail_notify_error_to_sender.py new file mode 100644 index 00000000000..4ba253a3a1a --- /dev/null +++ b/fetchmail_notify_error_to_sender/tests/test_fetchmail_notify_error_to_sender.py @@ -0,0 +1,94 @@ +# Copyright 2025 Onestein () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.addons.base.tests.common import BaseCommon + +MAIL_TEMPLATE = """Return-Path: +To: {to} +Received: by mail1.openerp.com (Postfix, from userid 10002) + id 5DF9ABFB2A; Fri, 30 May 2025 16:16:39 +0200 (CEST) +From: {email_from} +Subject: {subject} +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_4200734_24778174.1344608186754" +Date: Fri, 30 May 2025 14:16:26 +0000 +Message-ID: {msg_id} +------=_Part_4200734_24778174.1344608186754 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable + +Testing FetchMail Notify Error To Sender! + +-- +Your Dear Customer +------=_Part_4200734_24778174.1344608186754 +Content-Type: text/html; charset=utf-8 +Content-Transfer-Encoding: quoted-printable + + + + =20 + + =20 + =20 + +

Testing FetchMail Notify Error To Sender!

+ +

--
+ Your Dear Customer +

+ + +------=_Part_4200734_24778174.1344608186754-- +""" + + +class TestFetchmailNotifyErrorToSender(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.fetchmail_server = cls.env["fetchmail.server"].create( + [ + { + "name": "Test Server", + "server_type": "pop", + "server": "test", + "port": 110, + "user": "test", + "password": "test", + "state": "done", + } + ] + ) + + def message_process(self, fetchmail_server_id=None): + MailThread = self.env["mail.thread"] + message = MAIL_TEMPLATE.format( + to="test@123.com", + subject="Test Fetchmail Error Notification", + email_from=self.env.user.email, + msg_id="168242744424.20.2028152230359369389@dd607af32154", + ) + if fetchmail_server_id: + MailThread = MailThread.with_context( + default_fetchmail_server_id=fetchmail_server_id + ) + MailThread.message_process( + model=None, + message=message, + ) + + def test_fetchmail_notify_error_without_fetchmail_server(self): + with self.assertRaises(ValueError): + self.message_process() + + def test_fetchmail_notify_error_with_fetchmail(self): + self.fetchmail_server.error_notice_template_id = False + with self.assertRaises(ValueError): + self.message_process(fetchmail_server_id=self.fetchmail_server.id) + self.fetchmail_server.error_notice_template_id = self.env.ref( + "fetchmail_notify_error_to_sender.email_template_error_notice" + ) + with self.assertRaises(ValueError): + self.message_process(fetchmail_server_id=self.fetchmail_server.id) diff --git a/fetchmail_notify_error_to_sender/views/fetchmail_view.xml b/fetchmail_notify_error_to_sender/views/fetchmail_view.xml index fa25f1fac20..7b75eb97d41 100644 --- a/fetchmail_notify_error_to_sender/views/fetchmail_view.xml +++ b/fetchmail_notify_error_to_sender/views/fetchmail_view.xml @@ -3,9 +3,9 @@ fetchmail.server.form fetchmail.server - + - + From a926732f597e0d8cb70ecf87c6203d8145073209 Mon Sep 17 00:00:00 2001 From: mymage Date: Tue, 19 Aug 2025 13:07:58 +0000 Subject: [PATCH 27/29] Translated using Weblate (Italian) Currently translated at 100.0% (12 of 12 strings) Translation: server-tools-18.0/server-tools-18.0-fetchmail_notify_error_to_sender Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-fetchmail_notify_error_to_sender/it/ --- fetchmail_notify_error_to_sender/i18n/it.po | 37 +++++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/fetchmail_notify_error_to_sender/i18n/it.po b/fetchmail_notify_error_to_sender/i18n/it.po index e960e9fc5df..3e46af25ef6 100644 --- a/fetchmail_notify_error_to_sender/i18n/it.po +++ b/fetchmail_notify_error_to_sender/i18n/it.po @@ -9,15 +9,15 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-01-06 02:25+0000\n" -"PO-Revision-Date: 2022-12-30 11:46+0000\n" -"Last-Translator: Francesco Foresti \n" +"PO-Revision-Date: 2025-08-19 15:27+0000\n" +"Last-Translator: mymage \n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.14.1\n" +"X-Generator: Weblate 5.10.4\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice @@ -38,30 +38,45 @@ msgid "" "

\n" " " msgstr "" +"
\n" +"

\n" +"

\n" +"

Salve ,

\n" +"

c'è un problema con la sua e-mail:

\n" +"

Forse è stato utilizzato un destinatario erratp??

\n" +"


\n" +"

Dettagli tecnici:

\n" +"

\n" +"
\n" +"

\n" +"
\n" +" " #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server__changeset_change_ids #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_mail_thread__changeset_change_ids msgid "Changeset Changes" -msgstr "" +msgstr "Modifiche dell'insieme di modifiche" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server__changeset_ids #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_mail_thread__changeset_ids msgid "Changesets" -msgstr "" +msgstr "Insieme di modifiche" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server__count_pending_changeset_changes #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_mail_thread__count_pending_changeset_changes msgid "Count Pending Changeset Changes" -msgstr "" +msgstr "Conteggio modifiche dell'insieme di modifiche in attesa" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server__count_pending_changesets #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_mail_thread__count_pending_changesets msgid "Count Pending Changesets" -msgstr "" +msgstr "Conteggio insieme di modifiche in attesa" #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread @@ -76,17 +91,17 @@ msgstr "Template Notifica Errore" #. module: fetchmail_notify_error_to_sender #: model:mail.template,name:fetchmail_notify_error_to_sender.email_template_error_notice msgid "Fetchmail - error notice" -msgstr "" +msgstr "Fetchmail - notifica errore" #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server msgid "Incoming Mail Server" -msgstr "" +msgstr "Server di posta in arrivo" #. module: fetchmail_notify_error_to_sender #: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice msgid "Receiving error with: {{ctx.get('sender_message').get('subject')}}" -msgstr "" +msgstr "Ricezione errore con: {{ctx.get('sender_message').get('subject')}}" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server__error_notice_template_id @@ -101,7 +116,7 @@ msgstr "" #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server__user_can_see_changeset #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_mail_thread__user_can_see_changeset msgid "User Can See Changeset" -msgstr "" +msgstr "L'utente può vedere l'insieme delle modifiche" #, fuzzy #~ msgid "" From 92b9ed2fb31293bfea73cae8dbe5511f86ece0f9 Mon Sep 17 00:00:00 2001 From: Nils Coenen Date: Fri, 26 Dec 2025 12:06:31 +0000 Subject: [PATCH 28/29] Translated using Weblate (German) Currently translated at 100.0% (12 of 12 strings) Translation: server-tools-18.0/server-tools-18.0-fetchmail_notify_error_to_sender Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-fetchmail_notify_error_to_sender/de/ --- fetchmail_notify_error_to_sender/i18n/de.po | 46 +++++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/fetchmail_notify_error_to_sender/i18n/de.po b/fetchmail_notify_error_to_sender/i18n/de.po index cd19654074f..9fbec66c574 100644 --- a/fetchmail_notify_error_to_sender/i18n/de.po +++ b/fetchmail_notify_error_to_sender/i18n/de.po @@ -9,14 +9,15 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-12-01 02:10+0000\n" -"PO-Revision-Date: 2017-12-01 02:10+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"PO-Revision-Date: 2025-12-26 14:42+0000\n" +"Last-Translator: Nils Coenen \n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.10.4\n" #. module: fetchmail_notify_error_to_sender #: model:mail.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice @@ -37,55 +38,71 @@ msgid "" "
\n" " " msgstr "" +"
\n" +"

\n" +"

\n" +"

Hallo ,

\n" +"

wir haben ein Problem mit Ihrer E-Mail:

\n" +"

Vielleicht haben Sie eine falsche Empfängeradresse " +"verwendet?

\n" +"


\n" +"

Technische Details:

\n" +"

\n" +"
\n" +"

\n" +"
\n" +" " #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server__changeset_change_ids #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_mail_thread__changeset_change_ids msgid "Changeset Changes" -msgstr "" +msgstr "Änderungen am Änderungssatz" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server__changeset_ids #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_mail_thread__changeset_ids msgid "Changesets" -msgstr "" +msgstr "Änderungssatz" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server__count_pending_changeset_changes #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_mail_thread__count_pending_changeset_changes msgid "Count Pending Changeset Changes" -msgstr "" +msgstr "Änderungsanzahl des ausstehenden Änderungssatzes" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server__count_pending_changesets #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_mail_thread__count_pending_changesets msgid "Count Pending Changesets" -msgstr "" +msgstr "Anzahl der ausstehenden Änderungssätze" #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread msgid "Email Thread" -msgstr "" +msgstr "E-Mail-Thread" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server__error_notice_template_id msgid "Error notice template" -msgstr "" +msgstr "Vorlage für Fehlerhinweise" #. module: fetchmail_notify_error_to_sender #: model:mail.template,name:fetchmail_notify_error_to_sender.email_template_error_notice msgid "Fetchmail - error notice" -msgstr "" +msgstr "Fetchmail - Fehlerhinweis" #. module: fetchmail_notify_error_to_sender #: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server msgid "Incoming Mail Server" -msgstr "" +msgstr "Eingehender Mailserver" #. module: fetchmail_notify_error_to_sender #: model:mail.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice msgid "Receiving error with: {{ctx.get('sender_message').get('subject')}}" -msgstr "" +msgstr "Empfangsfehler mit: {{ctx.get('sender_message').get('subject')}}" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,help:fetchmail_notify_error_to_sender.field_fetchmail_server__error_notice_template_id @@ -93,12 +110,15 @@ msgid "" "Set here the template to use to send notice to sender when errors occur " "while fetching email" msgstr "" +"Legen Sie hier die Vorlage fest, die zum Senden einer Benachrichtigung an " +"den Absender verwendet werden soll, wenn beim Abrufen einer E-Mail Fehler " +"auftreten" #. module: fetchmail_notify_error_to_sender #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_fetchmail_server__user_can_see_changeset #: model:ir.model.fields,field_description:fetchmail_notify_error_to_sender.field_mail_thread__user_can_see_changeset msgid "User Can See Changeset" -msgstr "" +msgstr "Der Benutzer kann Änderungssatz sehen" #~ msgid "POP/IMAP Server" #~ msgstr "POP/IMAP-Server" From 72008c9b3e5c561e7c23db96bc77e693083d44a0 Mon Sep 17 00:00:00 2001 From: Christopher Rogos Date: Thu, 23 Apr 2026 14:49:32 +0000 Subject: [PATCH 29/29] [MIG] fetchmail_notify_error_to_sender: Migration to 19.0 --- fetchmail_notify_error_to_sender/README.rst | 26 +++++++++---------- .../__manifest__.py | 3 +-- fetchmail_notify_error_to_sender/i18n/it.po | 2 +- .../static/description/index.html | 6 ++--- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/fetchmail_notify_error_to_sender/README.rst b/fetchmail_notify_error_to_sender/README.rst index 2e1f46f2f1e..15b8767ac97 100644 --- a/fetchmail_notify_error_to_sender/README.rst +++ b/fetchmail_notify_error_to_sender/README.rst @@ -21,13 +21,13 @@ Fetchmail Notify Error to Sender :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github - :target: https://github.com/OCA/server-tools/tree/18.0/fetchmail_notify_error_to_sender + :target: https://github.com/OCA/server-tools/tree/19.0/fetchmail_notify_error_to_sender :alt: OCA/server-tools .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-fetchmail_notify_error_to_sender + :target: https://translation.odoo-community.org/projects/server-tools-19-0/server-tools-19-0-fetchmail_notify_error_to_sender :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=18.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=19.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -64,7 +64,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -80,14 +80,14 @@ Authors Contributors ------------ -- Lorenzo Battistini -- Miquel Raïch (migration to v9 and v10) -- Hai Dinh (migration to V11) -- Nedas Zilinskas (Ventor, Xpansa Group - ) -- Denis Valenchyts (VentorTech OU - ) -- Helly kapatel +- Lorenzo Battistini +- Miquel Raïch (migration to v9 and v10) +- Hai Dinh (migration to V11) +- Nedas Zilinskas (Ventor, Xpansa Group + ) +- Denis Valenchyts (VentorTech OU + ) +- Helly kapatel Maintainers ----------- @@ -102,6 +102,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/server-tools `_ project on GitHub. +This module is part of the `OCA/server-tools `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fetchmail_notify_error_to_sender/__manifest__.py b/fetchmail_notify_error_to_sender/__manifest__.py index cd2b3a10c56..a3e4f565613 100644 --- a/fetchmail_notify_error_to_sender/__manifest__.py +++ b/fetchmail_notify_error_to_sender/__manifest__.py @@ -6,14 +6,13 @@ { "name": "Fetchmail Notify Error to Sender", "summary": "If fetching mails gives error, send an email to sender", - "version": "18.0.1.0.0", + "version": "19.0.1.0.0", "category": "Tools", "author": "Agile Business Group,ForgeFlow,Odoo Community Association (OCA)", "website": "https://github.com/OCA/server-tools", "license": "AGPL-3", "depends": ["mail"], "data": ["views/fetchmail_view.xml", "data/email_template_data.xml"], - "qweb": [], "installable": True, "application": False, } diff --git a/fetchmail_notify_error_to_sender/i18n/it.po b/fetchmail_notify_error_to_sender/i18n/it.po index 3e46af25ef6..68c2d7a734b 100644 --- a/fetchmail_notify_error_to_sender/i18n/it.po +++ b/fetchmail_notify_error_to_sender/i18n/it.po @@ -45,7 +45,7 @@ msgstr "" "/>,

\n" "

c'è un problema con la sua e-mail:

\n" -"

Forse è stato utilizzato un destinatario erratp??

\n" +"

Forse è stato utilizzato un destinatario errato?

\n" "


\n" "

Dettagli tecnici:

\n" "

\n" diff --git a/fetchmail_notify_error_to_sender/static/description/index.html b/fetchmail_notify_error_to_sender/static/description/index.html index a4f09d952c7..b154b759cbf 100644 --- a/fetchmail_notify_error_to_sender/static/description/index.html +++ b/fetchmail_notify_error_to_sender/static/description/index.html @@ -374,7 +374,7 @@

Fetchmail Notify Error to Sender

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:b7ccf8c7dcd1beaf104ae84d66594da371c22a1f680f4d7378848b5334a37204 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

If fetchmail is not able to correctly route an email, the email is “silently” lost (you get an error message in server log).

For example, if you configure odoo mail system to route received emails @@ -411,7 +411,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -445,7 +445,7 @@

Maintainers

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/server-tools project on GitHub.

+

This module is part of the OCA/server-tools project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.