porting fetchmail_notify_error_to_sender to 10.0

pull/2982/head
eLBati 2017-07-13 18:05:36 +02:00 committed by BT-cjimeno
parent c7f6f8facc
commit 6a416a3e91
No known key found for this signature in database
5 changed files with 51 additions and 85 deletions

View File

@ -6,10 +6,10 @@
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"MIME-Version: 1.0\n"
@ -32,36 +32,26 @@ msgid ""
"</div>\n"
" "
msgstr ""
"\n"
"<div>\n"
" <p>Hallo ${ctx.get('sender_message').get('from')},</p>\n"
" <p>wir haben ein Problem mit Ihrer Email: <i>${ctx.get('sender_message').get('subject')}</i></p>\n"
" <p>Vielleicht haben Sie nur die falsche Empfängeradresse angegeben?</p>\n"
" <p><br/></p>\n"
" <p>Technische Details:</p>\n"
" <p><i>${ctx.get('route_exception').message}</i></p>\n"
"</div>\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."

View File

@ -3,14 +3,14 @@
# * fetchmail_notify_error_to_sender
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
# Paolo Valier <paolo.valier@hotmail.it>, 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 <transbot@odoo-community.org>, 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 <paolo.valier@hotmail.it>, 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 ""
"</div>\n"
" "
msgstr ""
"\n"
"<div>\n"
" <p>Salve ${ctx.get('sender_message').get('from')},</p>\n"
" <p>abbiamo avuto un problema con la tua mail: <i>${ctx.get('sender_message').get('subject')}</i></p>\n"
" <p>Forse hai usato un indirizzo errato?</p>\n"
" <p><br/></p>\n"
" <p>Dettagli tecnici:</p>\n"
" <p><i>${ctx.get('route_exception').message}</i></p>\n"
"</div>\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"

View File

@ -6,10 +6,10 @@
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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"

View File

@ -6,10 +6,10 @@
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 2017\n"
"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n"
"MIME-Version: 1.0\n"
@ -32,26 +32,16 @@ msgid ""
"</div>\n"
" "
msgstr ""
"\n"
"<div>\n"
" <p>Pozdravljeni ${ctx.get('sender_message').get('from')}.</p>\n"
" <p>Z vašim e-poštnim sporočilom imamo težave: <i>${ctx.get('sender_message').get('subject')}</i></p>\n"
" <p>Ste mogoče uporabili napačen e-poštni naslov?</p>\n"
" <p><br/></p>\n"
" <p>Tehnični podatki:</p>\n"
" <p><i>${ctx.get('route_exception').message}</i></p>\n"
"</div>\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"

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
# Copyright 2015-2017 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
# Copyright 2017 Eficent <http://www.eficent.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@ -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