From df25f4aa39826a02154a52093a886a27d84a1a87 Mon Sep 17 00:00:00 2001 From: Lois Rilo Date: Tue, 16 Jul 2019 15:49:41 +0200 Subject: [PATCH 1/3] [12.0][FIX] mail_debrand: debrand regular notifications. without this fix, any regular notification (added as follower, thread notifications...) were not parsed at all and as a consequence also not debranded. --- mail_debrand/README.rst | 8 ++++++++ mail_debrand/__manifest__.py | 6 +++++- mail_debrand/models/__init__.py | 1 + mail_debrand/models/mail_thread.py | 14 ++++++++++++++ mail_debrand/readme/CONTRIBUTORS.rst | 2 ++ mail_debrand/static/description/index.html | 20 +++++++++++++++----- 6 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 mail_debrand/models/mail_thread.py diff --git a/mail_debrand/README.rst b/mail_debrand/README.rst index 7d5789512..cdbf04b00 100644 --- a/mail_debrand/README.rst +++ b/mail_debrand/README.rst @@ -60,9 +60,17 @@ Do not contact contributors directly about support or help with technical issues Credits ======= +Authors +~~~~~~~ + +* Tecnativa +* Eficent + Contributors ~~~~~~~~~~~~ +* Pedro M. Baeza +* Lois Rilo * Graeme Gellatly Maintainers diff --git a/mail_debrand/__manifest__.py b/mail_debrand/__manifest__.py index 9e090665b..216a834bd 100644 --- a/mail_debrand/__manifest__.py +++ b/mail_debrand/__manifest__.py @@ -1,3 +1,7 @@ +# Copyright 2016 Tecnativa - Jairo Llopis +# Copyright 2017 Tecnativa - Pedro M. Baeza +# Copyright 2019 Eficent Business and IT Consulting Services S.L. +# - Lois Rilo # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { @@ -6,7 +10,7 @@ "version": "12.0.2.0.0", "category": "Social Network", "website": "https://github.com/OCA/social/", - "author": "Odoo Community Association (OCA)", + "author": "Tecnativa, Eficent, Odoo Community Association (OCA)", "license": "AGPL-3", "installable": True, "depends": [ diff --git a/mail_debrand/models/__init__.py b/mail_debrand/models/__init__.py index 44e83956e..89e090b24 100644 --- a/mail_debrand/models/__init__.py +++ b/mail_debrand/models/__init__.py @@ -1 +1,2 @@ from . import mail_template +from . import mail_thread diff --git a/mail_debrand/models/mail_thread.py b/mail_debrand/models/mail_thread.py new file mode 100644 index 000000000..7fc6f0a2a --- /dev/null +++ b/mail_debrand/models/mail_thread.py @@ -0,0 +1,14 @@ +# Copyright 2019 Eficent Business and IT Consulting Services S.L. +# Lois Rilo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models + + +class MailThread(models.AbstractModel): + _inherit = "mail.thread" + + def _replace_local_links(self, html, base_url=None): + html = super()._replace_local_links(html, base_url=base_url) + html_debranded = self.env["mail.template"]._debrand_body(html) + return html_debranded diff --git a/mail_debrand/readme/CONTRIBUTORS.rst b/mail_debrand/readme/CONTRIBUTORS.rst index 0e4d96ea5..b5f7ce79c 100644 --- a/mail_debrand/readme/CONTRIBUTORS.rst +++ b/mail_debrand/readme/CONTRIBUTORS.rst @@ -1 +1,3 @@ +* Pedro M. Baeza +* Lois Rilo * Graeme Gellatly diff --git a/mail_debrand/static/description/index.html b/mail_debrand/static/description/index.html index 6843c3ed9..67804edc7 100644 --- a/mail_debrand/static/description/index.html +++ b/mail_debrand/static/description/index.html @@ -380,8 +380,9 @@ specifically the ‘using Odoo’ of notifications or the ‘Powered by Odoo’<
  • Bug Tracker
  • Credits
  • @@ -414,14 +415,23 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

    Credits

    -
    -

    Contributors

    +
    +

    Authors

      +
    • Tecnativa
    • +
    • Eficent
    • +
    +
    +
    +

    Contributors

    +
    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    Odoo Community Association

    OCA, or the Odoo Community Association, is a nonprofit organization whose From 41da96e64f2f49f47e10cc84d6b0fcd6bf3e2377 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Sat, 20 Jul 2019 07:56:34 +0000 Subject: [PATCH 2/3] [UPD] Update mail_debrand.pot --- mail_debrand/i18n/mail_debrand.pot | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mail_debrand/i18n/mail_debrand.pot b/mail_debrand/i18n/mail_debrand.pot index f938b7c70..c4440e3a4 100644 --- a/mail_debrand/i18n/mail_debrand.pot +++ b/mail_debrand/i18n/mail_debrand.pot @@ -18,6 +18,11 @@ msgstr "" msgid "Email Templates" msgstr "" +#. module: mail_debrand +#: model:ir.model,name:mail_debrand.model_mail_thread +msgid "Email Thread" +msgstr "" + #. module: mail_debrand #: code:addons/mail_debrand/models/mail_template.py:15 #, python-format From a85acdc63cebd448e961791333fb5d5f9c6eb519 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 20 Jul 2019 08:15:33 +0000 Subject: [PATCH 3/3] mail_debrand 12.0.2.0.1 --- mail_debrand/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail_debrand/__manifest__.py b/mail_debrand/__manifest__.py index 216a834bd..f0cd93d42 100644 --- a/mail_debrand/__manifest__.py +++ b/mail_debrand/__manifest__.py @@ -7,7 +7,7 @@ { "name": "Mail Debrand", "summary": "Remove Odoo branding in sent emails", - "version": "12.0.2.0.0", + "version": "12.0.2.0.1", "category": "Social Network", "website": "https://github.com/OCA/social/", "author": "Tecnativa, Eficent, Odoo Community Association (OCA)",