mirror of https://github.com/OCA/social.git
[MIG] [10.0] mail_footer_notified_partner (#200)
* [NEW][mail_footer_notified_partners] This module adds into the footer the partner's name notified by this email * [CHG] Use common.TransactionCase * OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex * [FIX][mail_footer_notified_partners] Use @api.model instead of @api.one. * OCA Transbot updated translations from Transifex * [FIX] remove en.po that was erroneously created by transbot * Pass context * OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex * [MIG] mail_footer_notified_partner: Migration to 10.0pull/448/head
parent
eeedcbd41d
commit
074d12ba7a
|
@ -0,0 +1,52 @@
|
||||||
|
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||||
|
:target: https://www.gnu.org/licenses/agpl
|
||||||
|
:alt: License: AGPL-3
|
||||||
|
|
||||||
|
================================
|
||||||
|
Notified partners in mail footer
|
||||||
|
================================
|
||||||
|
|
||||||
|
This module adds the list of notified partners in the footer of notification e-mails sent by Odoo.
|
||||||
|
The partner will be added if its 'notify_email' is not 'none'.
|
||||||
|
(In order to be consistent with Odoo)
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||||
|
:target: https://runbot.odoo-community.org/runbot/205/10.0
|
||||||
|
:alt: Try me on Runbot
|
||||||
|
|
||||||
|
Bug Tracker
|
||||||
|
===========
|
||||||
|
|
||||||
|
Bugs are tracked on `GitHub Issues
|
||||||
|
<https://github.com/OCA/social/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
|
||||||
|
=======
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
------------
|
||||||
|
|
||||||
|
* Jonathan Nemry <jonathan.nemry@acsone.eu>
|
||||||
|
* Simone Rubino <simone.rubino@agilebg.com>
|
||||||
|
|
||||||
|
Do not contact contributors directly about support or help with technical issues.
|
||||||
|
|
||||||
|
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 https://odoo-community.org.
|
|
@ -0,0 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2016 ACSONE SA/NV <https://acsone.eu>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
from . import models
|
|
@ -0,0 +1,19 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2016 ACSONE SA/NV <https://acsone.eu>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
{
|
||||||
|
"name": "Notified partners in mail footer",
|
||||||
|
"summary": """
|
||||||
|
This module adds the list of notified partners in the footer of
|
||||||
|
notification e-mails sent by Odoo.
|
||||||
|
""",
|
||||||
|
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
|
||||||
|
"installable": True,
|
||||||
|
"website": "http://acsone.eu",
|
||||||
|
"category": "Mail",
|
||||||
|
"version": "10.0.1.0.0",
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"depends": [
|
||||||
|
"mail",
|
||||||
|
],
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * mail_footer_notified_partners
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Rudolf Schnapka <rs@techno-flex.de>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: social (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-30 10:21+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-03-18 17:25+0000\n"
|
||||||
|
"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>\n"
|
||||||
|
"Language-Team: German (http://www.transifex.com/oca/OCA-social-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: mail_footer_notified_partners
|
||||||
|
#: code:addons/mail_footer_notified_partners/models/mail_followers.py:43
|
||||||
|
#, python-format
|
||||||
|
msgid "Also notified: "
|
||||||
|
msgstr "Auch benachrichtigt:"
|
||||||
|
|
||||||
|
#. module: mail_footer_notified_partners
|
||||||
|
#: model:ir.model,name:mail_footer_notified_partners.model_mail_notification
|
||||||
|
msgid "Notifications"
|
||||||
|
msgstr "Mitteilungen"
|
|
@ -0,0 +1,29 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * mail_footer_notified_partners
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: social (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2016-11-25 18:06+0000\n"
|
||||||
|
"PO-Revision-Date: 2016-10-11 11:53+0000\n"
|
||||||
|
"Last-Translator: Kostas Goutoudis <goutoudis@gmail.com>\n"
|
||||||
|
"Language-Team: Greek (Greece) (http://www.transifex.com/oca/OCA-social-8-0/language/el_GR/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: el_GR\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: mail_footer_notified_partners
|
||||||
|
#: code:addons/mail_footer_notified_partners/models/mail_followers.py:43
|
||||||
|
#, python-format
|
||||||
|
msgid "Also notified: "
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: mail_footer_notified_partners
|
||||||
|
#: model:ir.model,name:mail_footer_notified_partners.model_mail_notification
|
||||||
|
msgid "Notifications"
|
||||||
|
msgstr "Ειδοποιήσεις "
|
|
@ -0,0 +1,38 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * mail_footer_notified_partners
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Antonio Trueba, 2016
|
||||||
|
# Armando Vulcano Junior <vulcano@uol.com.br>, 2015
|
||||||
|
# Carles Antoli <carlesantoli@hotmail.com>, 2016
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014
|
||||||
|
# Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2016
|
||||||
|
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015
|
||||||
|
# Paolo Valier, 2016
|
||||||
|
# Rudolf Schnapka <rs@techno-flex.de>, 2016
|
||||||
|
# SaFi J. <safi2266@gmail.com>, 2015
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: social (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2016-04-30 02:47+0000\n"
|
||||||
|
"PO-Revision-Date: 2016-04-24 16:44+0000\n"
|
||||||
|
"Last-Translator: Carles Antoli <carlesantoli@hotmail.com>\n"
|
||||||
|
"Language-Team: Spanish (http://www.transifex.com/oca/OCA-social-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: mail_footer_notified_partners
|
||||||
|
#: code:addons/mail_footer_notified_partners/models/mail_followers.py:43
|
||||||
|
#, python-format
|
||||||
|
msgid "Also notified: "
|
||||||
|
msgstr "También notificado:"
|
||||||
|
|
||||||
|
#. module: mail_footer_notified_partners
|
||||||
|
#: model:ir.model,name:mail_footer_notified_partners.model_mail_notification
|
||||||
|
msgid "Notifications"
|
||||||
|
msgstr "Notificaciones"
|
|
@ -0,0 +1,29 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * mail_footer_notified_partners
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: social (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2016-11-25 18:06+0000\n"
|
||||||
|
"PO-Revision-Date: 2016-09-29 13:23+0000\n"
|
||||||
|
"Last-Translator: Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>\n"
|
||||||
|
"Language-Team: Finnish (http://www.transifex.com/oca/OCA-social-8-0/language/fi/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: fi\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: mail_footer_notified_partners
|
||||||
|
#: code:addons/mail_footer_notified_partners/models/mail_followers.py:43
|
||||||
|
#, python-format
|
||||||
|
msgid "Also notified: "
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: mail_footer_notified_partners
|
||||||
|
#: model:ir.model,name:mail_footer_notified_partners.model_mail_notification
|
||||||
|
msgid "Notifications"
|
||||||
|
msgstr "Ilmoitukset"
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * mail_footer_notified_partners
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Christophe CHAUVET <christophe.chauvet@gmail.com>, 2016
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: social (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2016-06-30 01:07+0000\n"
|
||||||
|
"PO-Revision-Date: 2016-06-17 14:15+0000\n"
|
||||||
|
"Last-Translator: Christophe CHAUVET <christophe.chauvet@gmail.com>\n"
|
||||||
|
"Language-Team: French (http://www.transifex.com/oca/OCA-social-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: mail_footer_notified_partners
|
||||||
|
#: code:addons/mail_footer_notified_partners/models/mail_followers.py:43
|
||||||
|
#, python-format
|
||||||
|
msgid "Also notified: "
|
||||||
|
msgstr "Également notifié:"
|
||||||
|
|
||||||
|
#. module: mail_footer_notified_partners
|
||||||
|
#: model:ir.model,name:mail_footer_notified_partners.model_mail_notification
|
||||||
|
msgid "Notifications"
|
||||||
|
msgstr "Notifications"
|
|
@ -0,0 +1,29 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * mail_footer_notified_partners
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: social (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2016-11-25 18:06+0000\n"
|
||||||
|
"PO-Revision-Date: 2016-02-26 16:19+0000\n"
|
||||||
|
"Last-Translator: <>\n"
|
||||||
|
"Language-Team: Italian (http://www.transifex.com/oca/OCA-social-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: mail_footer_notified_partners
|
||||||
|
#: code:addons/mail_footer_notified_partners/models/mail_followers.py:43
|
||||||
|
#, python-format
|
||||||
|
msgid "Also notified: "
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: mail_footer_notified_partners
|
||||||
|
#: model:ir.model,name:mail_footer_notified_partners.model_mail_notification
|
||||||
|
msgid "Notifications"
|
||||||
|
msgstr "Notifiche"
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * mail_footer_notified_partners
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2016
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: social (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2016-02-27 01:40+0000\n"
|
||||||
|
"PO-Revision-Date: 2016-02-27 16:56+0000\n"
|
||||||
|
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
|
||||||
|
"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-social-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: mail_footer_notified_partners
|
||||||
|
#: code:addons/mail_footer_notified_partners/models/mail_followers.py:43
|
||||||
|
#, python-format
|
||||||
|
msgid "Also notified: "
|
||||||
|
msgstr "Obveščeni tudi:"
|
||||||
|
|
||||||
|
#. module: mail_footer_notified_partners
|
||||||
|
#: model:ir.model,name:mail_footer_notified_partners.model_mail_notification
|
||||||
|
msgid "Notifications"
|
||||||
|
msgstr "Obvestila"
|
|
@ -0,0 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2016 ACSONE SA/NV <https://acsone.eu>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
from . import mail_followers
|
|
@ -0,0 +1,26 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2016 ACSONE SA/NV <https://acsone.eu>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
from odoo import models, api
|
||||||
|
from odoo.tools.translate import _
|
||||||
|
|
||||||
|
|
||||||
|
class MailNotification(models.Model):
|
||||||
|
_inherit = 'res.partner'
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _notify_send(self, body, subject, recipients, **mail_values):
|
||||||
|
body += self.get_additional_footer(recipients)
|
||||||
|
return super(MailNotification, self).\
|
||||||
|
_notify_send(body, subject, recipients, **mail_values)
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def get_additional_footer(self, recipients):
|
||||||
|
recipients_name = [
|
||||||
|
recipient.name for recipient in recipients
|
||||||
|
]
|
||||||
|
additional_footer = u'<br /><small>%s%s.</small><br />' % \
|
||||||
|
(_('Also notified: '),
|
||||||
|
', '.join(recipients_name))
|
||||||
|
return additional_footer
|
|
@ -0,0 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2016 ACSONE SA/NV <https://acsone.eu>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
from . import test_mail_notification
|
|
@ -0,0 +1,28 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2016 ACSONE SA/NV <https://acsone.eu>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
import odoo.tests.common as common
|
||||||
|
|
||||||
|
|
||||||
|
class TestMailNotification(common.TransactionCase):
|
||||||
|
def setUp(self):
|
||||||
|
super(TestMailNotification, self).setUp()
|
||||||
|
|
||||||
|
self.partner_obj = self.env['res.partner']
|
||||||
|
|
||||||
|
def test_get_signature_footer(self):
|
||||||
|
vals = {
|
||||||
|
'name': 'p1@example.com',
|
||||||
|
}
|
||||||
|
partner1 = self.partner_obj.create(vals)
|
||||||
|
|
||||||
|
body = 'this is the body'
|
||||||
|
subject = 'this is the subject'
|
||||||
|
recipients = partner1
|
||||||
|
emails, recipients_nbr = \
|
||||||
|
self.partner_obj._notify_send(body, subject, recipients)
|
||||||
|
|
||||||
|
self.assertTrue(
|
||||||
|
partner1.name in emails.body_html,
|
||||||
|
'Partner name is not in the body of the mail')
|
Loading…
Reference in New Issue