From 893f5aa5e3ed5a06daf2acb5a36b8ef1a7844ff8 Mon Sep 17 00:00:00 2001 From: Aungkokolin1997 Date: Fri, 9 Jan 2026 09:48:08 +0000 Subject: [PATCH] [ADD] mail_debranding --- mail_debranding/README.rst | 135 +++++ mail_debranding/__init__.py | 1 + mail_debranding/__manifest__.py | 25 + mail_debranding/i18n/de.po | 48 ++ mail_debranding/i18n/es.po | 53 ++ mail_debranding/i18n/fr.po | 65 +++ mail_debranding/i18n/fr_FR.po | 53 ++ mail_debranding/i18n/it.po | 53 ++ mail_debranding/i18n/mail_debrand.pot | 30 ++ mail_debranding/i18n/mail_debranding.pot | 47 ++ mail_debranding/i18n/nl.po | 65 +++ mail_debranding/i18n/pt.po | 56 ++ mail_debranding/i18n/sl.po | 66 +++ mail_debranding/i18n/sr_Latn.po | 49 ++ mail_debranding/i18n/sv.po | 53 ++ mail_debranding/i18n/tr.po | 50 ++ mail_debranding/models/__init__.py | 2 + mail_debranding/models/mail_mail.py | 15 + mail_debranding/models/mail_render_mixin.py | 96 ++++ mail_debranding/pyproject.toml | 3 + mail_debranding/readme/CONTRIBUTORS.md | 6 + mail_debranding/readme/DESCRIPTION.md | 2 + mail_debranding/readme/HISTORY.md | 8 + mail_debranding/readme/ROADMAP.md | 5 + mail_debranding/readme/USAGE.md | 5 + mail_debranding/static/description/icon.png | Bin 0 -> 5367 bytes mail_debranding/static/description/icon.svg | 248 +++++++++ mail_debranding/static/description/index.html | 484 ++++++++++++++++++ mail_debranding/tests/__init__.py | 3 + mail_debranding/tests/test_mail_debrand.py | 117 +++++ .../tests/test_mail_debrand_digest.py | 71 +++ .../tests/test_mail_debrand_signup.py | 28 + 32 files changed, 1942 insertions(+) create mode 100644 mail_debranding/README.rst create mode 100644 mail_debranding/__init__.py create mode 100644 mail_debranding/__manifest__.py create mode 100644 mail_debranding/i18n/de.po create mode 100644 mail_debranding/i18n/es.po create mode 100644 mail_debranding/i18n/fr.po create mode 100644 mail_debranding/i18n/fr_FR.po create mode 100644 mail_debranding/i18n/it.po create mode 100644 mail_debranding/i18n/mail_debrand.pot create mode 100644 mail_debranding/i18n/mail_debranding.pot create mode 100644 mail_debranding/i18n/nl.po create mode 100644 mail_debranding/i18n/pt.po create mode 100644 mail_debranding/i18n/sl.po create mode 100644 mail_debranding/i18n/sr_Latn.po create mode 100644 mail_debranding/i18n/sv.po create mode 100644 mail_debranding/i18n/tr.po create mode 100644 mail_debranding/models/__init__.py create mode 100644 mail_debranding/models/mail_mail.py create mode 100644 mail_debranding/models/mail_render_mixin.py create mode 100644 mail_debranding/pyproject.toml create mode 100644 mail_debranding/readme/CONTRIBUTORS.md create mode 100644 mail_debranding/readme/DESCRIPTION.md create mode 100644 mail_debranding/readme/HISTORY.md create mode 100644 mail_debranding/readme/ROADMAP.md create mode 100644 mail_debranding/readme/USAGE.md create mode 100644 mail_debranding/static/description/icon.png create mode 100644 mail_debranding/static/description/icon.svg create mode 100644 mail_debranding/static/description/index.html create mode 100644 mail_debranding/tests/__init__.py create mode 100644 mail_debranding/tests/test_mail_debrand.py create mode 100644 mail_debranding/tests/test_mail_debrand_digest.py create mode 100644 mail_debranding/tests/test_mail_debrand_signup.py diff --git a/mail_debranding/README.rst b/mail_debranding/README.rst new file mode 100644 index 0000000..8d5ed9b --- /dev/null +++ b/mail_debranding/README.rst @@ -0,0 +1,135 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============ +Mail Debrand +============ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:a260d5f972cb076e5789f2dfb9ee9e901f217503abb57c3238b42638f524bf8e + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |badge2| image:: https://img.shields.io/badge/license-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--brand-lightgray.png?logo=github + :target: https://github.com/OCA/server-brand/tree/19.0/mail_debranding + :alt: OCA/server-brand +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/server-brand-19-0/server-brand-19-0-mail_debranding + :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-brand&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module modifies the functionality of emails to remove the Odoo +branding, specifically the 'Powered by Odoo' + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +- Install it. +- Send an email. +- Nobody will know it comes from Odoo. + +Known issues / Roadmap +====================== + +Known issues: + +- Not all branding is removed from auth_signup's invitation email + because it is a longer, more complex snippet of HTML. Only the line + containing the link to Odoo.com is removed. + +Changelog +========= + +15.0.1.2.3 (2022-07-19) +----------------------- + +- [FIX] https://github.com/OCA/social/issues/915 +- [FIX] https://github.com/OCA/social/issues/936 + +12.0.1.0.0 (2018-11-06) +----------------------- + +- [NEW] Initial V12 version. Complete rewrite from v11. + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Tecnativa +* ForgeFlow +* Onestein +* Sodexis +* Nexterp Romania + +Contributors +------------ + +- Lois Rilo +- Graeme Gellatly +- `Tecnativa `__: + + - Pedro M. Baeza + - João Marques + +- Stefan Rijnhart stefan@opener.amsterdam + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +.. |maintainer-pedrobaeza| image:: https://github.com/pedrobaeza.png?size=40px + :target: https://github.com/pedrobaeza + :alt: pedrobaeza +.. |maintainer-joao-p-marques| image:: https://github.com/joao-p-marques.png?size=40px + :target: https://github.com/joao-p-marques + :alt: joao-p-marques + +Current `maintainers `__: + +|maintainer-pedrobaeza| |maintainer-joao-p-marques| + +This module is part of the `OCA/server-brand `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_debranding/__init__.py b/mail_debranding/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/mail_debranding/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mail_debranding/__manifest__.py b/mail_debranding/__manifest__.py new file mode 100644 index 0000000..ff05f15 --- /dev/null +++ b/mail_debranding/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright 2016 Tecnativa - Jairo Llopis +# Copyright 2017 Tecnativa - Pedro M. Baeza +# Copyright 2019 ForgeFlow S.L. - Lois Rilo +# 2020 NextERP Romania +# Copyright 2021 Tecnativa - João Marques +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Mail Debrand", + "summary": """Remove Odoo branding in sent emails + Removes anchor 20characters + """, + "version": "19.0.1.0.0", + "category": "Social Network", + "website": "https://github.com/OCA/server-brand", + "author": """Tecnativa, ForgeFlow, Onestein, Sodexis, Nexterp Romania, + Odoo Community Association (OCA)""", + "license": "AGPL-3", + "installable": True, + "depends": ["mail"], + "development_status": "Production/Stable", + "maintainers": ["pedrobaeza", "joao-p-marques"], +} diff --git a/mail_debranding/i18n/de.po b/mail_debranding/i18n/de.po new file mode 100644 index 0000000..8545330 --- /dev/null +++ b/mail_debranding/i18n/de.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debrand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\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" + +#. module: mail_debranding +#. odoo-python +#: code:addons/mail_debranding/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__display_name +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__display_name +msgid "Display Name" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__id +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__id +msgid "ID" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_mail +msgid "Outgoing Mails" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,website_form_label:mail_debranding.model_mail_mail +msgid "Send an E-mail" +msgstr "" diff --git a/mail_debranding/i18n/es.po b/mail_debranding/i18n/es.po new file mode 100644 index 0000000..6a63ca8 --- /dev/null +++ b/mail_debranding/i18n/es.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debrand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-09-03 13:36+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\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.17\n" + +#. module: mail_debranding +#. odoo-python +#: code:addons/mail_debranding/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "Conectar" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__display_name +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__id +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__id +msgid "ID" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "Mezcla de renderizado de correo" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_mail +msgid "Outgoing Mails" +msgstr "Correos salientes" + +#. module: mail_debranding +#: model:ir.model,website_form_label:mail_debranding.model_mail_mail +msgid "Send an E-mail" +msgstr "" + +#~ msgid "Last Modified on" +#~ msgstr "Última modificación en" diff --git a/mail_debranding/i18n/fr.po b/mail_debranding/i18n/fr.po new file mode 100644 index 0000000..8883459 --- /dev/null +++ b/mail_debranding/i18n/fr.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debrand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-02-23 16:34+0000\n" +"Last-Translator: Vincent Hatakeyama \n" +"Language-Team: none\n" +"Language: fr\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.17\n" + +#. module: mail_debranding +#. odoo-python +#: code:addons/mail_debranding/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "Connexion" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__display_name +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__display_name +msgid "Display Name" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__id +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__id +msgid "ID" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "Mixin de rendu de courriel" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_mail +msgid "Outgoing Mails" +msgstr "Courriels sortants" + +#. module: mail_debranding +#: model:ir.model,website_form_label:mail_debranding.model_mail_mail +msgid "Send an E-mail" +msgstr "" + +#~ msgid "Email Templates" +#~ msgstr "Modèles d'emails" + +#~ msgid "Email Thread" +#~ msgstr "Discussion par email" + +#~ msgid "Odoo" +#~ msgstr "Odoo" + +#~ msgid "Powered by" +#~ msgstr "Propulsé par" + +#~ msgid "using" +#~ msgstr "utilisant" diff --git a/mail_debranding/i18n/fr_FR.po b/mail_debranding/i18n/fr_FR.po new file mode 100644 index 0000000..5005cc5 --- /dev/null +++ b/mail_debranding/i18n/fr_FR.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debrand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-04-11 18:46+0000\n" +"Last-Translator: Yves Le Doeuff \n" +"Language-Team: none\n" +"Language: fr_FR\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.3.2\n" + +#. module: mail_debranding +#. odoo-python +#: code:addons/mail_debranding/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__display_name +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__id +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__id +msgid "ID" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "Rendu du courrier" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_mail +msgid "Outgoing Mails" +msgstr "E-mails sortants" + +#. module: mail_debranding +#: model:ir.model,website_form_label:mail_debranding.model_mail_mail +msgid "Send an E-mail" +msgstr "" + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modification" diff --git a/mail_debranding/i18n/it.po b/mail_debranding/i18n/it.po new file mode 100644 index 0000000..aa85f08 --- /dev/null +++ b/mail_debranding/i18n/it.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debrand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-07-08 08:59+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\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 5.6.2\n" + +#. module: mail_debranding +#. odoo-python +#: code:addons/mail_debranding/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "Connetti" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__display_name +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__id +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__id +msgid "ID" +msgstr "ID" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "Mixin resa posta" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_mail +msgid "Outgoing Mails" +msgstr "Posta in uscita" + +#. module: mail_debranding +#: model:ir.model,website_form_label:mail_debranding.model_mail_mail +msgid "Send an E-mail" +msgstr "" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima modifica il" diff --git a/mail_debranding/i18n/mail_debrand.pot b/mail_debranding/i18n/mail_debrand.pot new file mode 100644 index 0000000..a29d4f7 --- /dev/null +++ b/mail_debranding/i18n/mail_debrand.pot @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debrand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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: mail_debrand +#. odoo-python +#: code:addons/mail_debrand/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "" + +#. module: mail_debrand +#: model:ir.model,name:mail_debrand.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "" + +#. module: mail_debrand +#: model:ir.model,name:mail_debrand.model_mail_mail +msgid "Outgoing Mails" +msgstr "" diff --git a/mail_debranding/i18n/mail_debranding.pot b/mail_debranding/i18n/mail_debranding.pot new file mode 100644 index 0000000..ff9c619 --- /dev/null +++ b/mail_debranding/i18n/mail_debranding.pot @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debranding +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 19.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: mail_debranding +#. odoo-python +#: code:addons/mail_debranding/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__display_name +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__display_name +msgid "Display Name" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__id +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__id +msgid "ID" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_mail +msgid "Outgoing Mails" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,website_form_label:mail_debranding.model_mail_mail +msgid "Send an E-mail" +msgstr "" diff --git a/mail_debranding/i18n/nl.po b/mail_debranding/i18n/nl.po new file mode 100644 index 0000000..3aad378 --- /dev/null +++ b/mail_debranding/i18n/nl.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debrand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-05-17 21:47+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\n" +"Language: nl\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.3.2\n" + +#. module: mail_debranding +#. odoo-python +#: code:addons/mail_debranding/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__display_name +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__display_name +msgid "Display Name" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__id +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__id +msgid "ID" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_mail +msgid "Outgoing Mails" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,website_form_label:mail_debranding.model_mail_mail +msgid "Send an E-mail" +msgstr "" + +#, fuzzy +#~ msgid "Email Templates" +#~ msgstr "Email Templates" + +#, fuzzy +#~ msgid "Email Thread" +#~ msgstr "Email Thread" + +#, fuzzy +#~ msgid "Odoo" +#~ msgstr "Odoo" + +#~ msgid "Powered by" +#~ msgstr "Aangeboden door" diff --git a/mail_debranding/i18n/pt.po b/mail_debranding/i18n/pt.po new file mode 100644 index 0000000..2534d68 --- /dev/null +++ b/mail_debranding/i18n/pt.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debrand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-03-02 17:13+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\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 3.10\n" + +#. module: mail_debranding +#. odoo-python +#: code:addons/mail_debranding/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__display_name +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__display_name +msgid "Display Name" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__id +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__id +msgid "ID" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_mail +msgid "Outgoing Mails" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,website_form_label:mail_debranding.model_mail_mail +msgid "Send an E-mail" +msgstr "" + +#~ msgid "Email Templates" +#~ msgstr "Modelos de Email" + +#~ msgid "Email Thread" +#~ msgstr "Thread do email" diff --git a/mail_debranding/i18n/sl.po b/mail_debranding/i18n/sl.po new file mode 100644 index 0000000..a88b487 --- /dev/null +++ b/mail_debranding/i18n/sl.po @@ -0,0 +1,66 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debrand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-03-19 10:13+0000\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: none\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " +"n%100==4 ? 2 : 3;\n" +"X-Generator: Weblate 3.10\n" + +#. module: mail_debranding +#. odoo-python +#: code:addons/mail_debranding/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__display_name +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__display_name +msgid "Display Name" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__id +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__id +msgid "ID" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_mail +msgid "Outgoing Mails" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,website_form_label:mail_debranding.model_mail_mail +msgid "Send an E-mail" +msgstr "" + +#~ msgid "Email Templates" +#~ msgstr "Predloge e-pošte" + +#~ msgid "Email Thread" +#~ msgstr "E-poštna nit" + +#~ msgid "Odoo" +#~ msgstr "Odoo" + +#~ msgid "Powered by" +#~ msgstr "Powered by" + +#~ msgid "using" +#~ msgstr "z uporabo" diff --git a/mail_debranding/i18n/sr_Latn.po b/mail_debranding/i18n/sr_Latn.po new file mode 100644 index 0000000..0df4960 --- /dev/null +++ b/mail_debranding/i18n/sr_Latn.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debrand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: sr_Latn\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \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: mail_debranding +#. odoo-python +#: code:addons/mail_debranding/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__display_name +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__display_name +msgid "Display Name" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__id +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__id +msgid "ID" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_mail +msgid "Outgoing Mails" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,website_form_label:mail_debranding.model_mail_mail +msgid "Send an E-mail" +msgstr "" diff --git a/mail_debranding/i18n/sv.po b/mail_debranding/i18n/sv.po new file mode 100644 index 0000000..0b08e4a --- /dev/null +++ b/mail_debranding/i18n/sv.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debrand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-11-17 10:36+0000\n" +"Last-Translator: Simon S \n" +"Language-Team: none\n" +"Language: sv\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.3.2\n" + +#. module: mail_debranding +#. odoo-python +#: code:addons/mail_debranding/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__display_name +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__display_name +msgid "Display Name" +msgstr "Visningsnamn" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__id +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__id +msgid "ID" +msgstr "ID" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_mail +msgid "Outgoing Mails" +msgstr "Utgående e-postmeddelanden" + +#. module: mail_debranding +#: model:ir.model,website_form_label:mail_debranding.model_mail_mail +msgid "Send an E-mail" +msgstr "" + +#~ msgid "Last Modified on" +#~ msgstr "Senast ändrad den" diff --git a/mail_debranding/i18n/tr.po b/mail_debranding/i18n/tr.po new file mode 100644 index 0000000..92e989e --- /dev/null +++ b/mail_debranding/i18n/tr.po @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_debrand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-04-15 11:24+0000\n" +"Last-Translator: Betül Öğmen \n" +"Language-Team: none\n" +"Language: tr\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 5.10.4\n" + +#. module: mail_debranding +#. odoo-python +#: code:addons/mail_debranding/tests/test_mail_debrand_digest.py:0 +msgid "Connect" +msgstr "Bağlan" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__display_name +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__display_name +msgid "Display Name" +msgstr "" + +#. module: mail_debranding +#: model:ir.model.fields,field_description:mail_debranding.field_mail_mail__id +#: model:ir.model.fields,field_description:mail_debranding.field_mail_render_mixin__id +msgid "ID" +msgstr "" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_render_mixin +msgid "Mail Render Mixin" +msgstr "Mail Oluşturma Karması" + +#. module: mail_debranding +#: model:ir.model,name:mail_debranding.model_mail_mail +msgid "Outgoing Mails" +msgstr "Giden Postalar" + +#. module: mail_debranding +#: model:ir.model,website_form_label:mail_debranding.model_mail_mail +msgid "Send an E-mail" +msgstr "" diff --git a/mail_debranding/models/__init__.py b/mail_debranding/models/__init__.py new file mode 100644 index 0000000..1532c75 --- /dev/null +++ b/mail_debranding/models/__init__.py @@ -0,0 +1,2 @@ +from . import mail_render_mixin +from . import mail_mail diff --git a/mail_debranding/models/mail_mail.py b/mail_debranding/models/mail_mail.py new file mode 100644 index 0000000..099f320 --- /dev/null +++ b/mail_debranding/models/mail_mail.py @@ -0,0 +1,15 @@ +# Copyright 2019 O4SB - Graeme Gellatly +# Copyright 2019 Tecnativa - Ernesto Tejeda +# Copyright 2020 Onestein - Andrea Stirpe +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import models + + +class MailMail(models.AbstractModel): + _inherit = "mail.mail" + + def _prepare_outgoing_body(self): + body_html = super()._prepare_outgoing_body() + return self.env["mail.render.mixin"].remove_href_odoo( + body_html or "", to_keep=self.body + ) diff --git a/mail_debranding/models/mail_render_mixin.py b/mail_debranding/models/mail_render_mixin.py new file mode 100644 index 0000000..5497828 --- /dev/null +++ b/mail_debranding/models/mail_render_mixin.py @@ -0,0 +1,96 @@ +# Copyright 2019 O4SB - Graeme Gellatly +# Copyright 2019 Tecnativa - Ernesto Tejeda +# Copyright 2020 Onestein - Andrea Stirpe +# Copyright 2021 Tecnativa - João Marques +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +import re + +from lxml import etree, html +from markupsafe import Markup + +from odoo import api, models + + +class MailRenderMixin(models.AbstractModel): + _inherit = "mail.render.mixin" + + def remove_href_odoo(self, value, to_keep=None): + if len(value) < 20: + return value + # value can be bytes or markup; ensure we get a proper string and preserve type + back_to_bytes = False + back_to_markup = False + if isinstance(value, bytes): + back_to_bytes = True + value = value.decode() + if isinstance(value, Markup): + back_to_markup = True + has_dev_odoo_link = re.search( + r"") + tree = html.fromstring(value) + odoo_anchors = tree.xpath('//a[contains(@href,"odoo.com")]') + for elem in odoo_anchors: + parent = elem.getparent() + # Remove "Powered by", "using" etc. + previous = elem.getprevious() + if previous is not None: + previous.tail = etree.CDATA(" ") + elif parent.text: + parent.text = etree.CDATA(" ") + parent.remove(elem) + value = etree.tostring( + tree, pretty_print=True, method="html", encoding="unicode" + ) + if to_keep: + value = value.replace("", to_keep) + if back_to_bytes: + value = value.encode() + elif back_to_markup: + value = Markup(value) + return value + + @api.model + def _render_template( + self, + template_src, + model, + res_ids, + engine="inline_template", + add_context=None, + options=None, + ): + """replace anything that is with odoo in templates + if is a \> +- Graeme Gellatly \<\> +- [Tecnativa](https://www.tecnativa.com): + - Pedro M. Baeza + - João Marques +- Stefan Rijnhart diff --git a/mail_debranding/readme/DESCRIPTION.md b/mail_debranding/readme/DESCRIPTION.md new file mode 100644 index 0000000..e0c8789 --- /dev/null +++ b/mail_debranding/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module modifies the functionality of emails to remove the Odoo +branding, specifically the 'Powered by Odoo' diff --git a/mail_debranding/readme/HISTORY.md b/mail_debranding/readme/HISTORY.md new file mode 100644 index 0000000..888b4a9 --- /dev/null +++ b/mail_debranding/readme/HISTORY.md @@ -0,0 +1,8 @@ +## 15.0.1.2.3 (2022-07-19) + +- \[FIX\] +- \[FIX\] + +## 12.0.1.0.0 (2018-11-06) + +- \[NEW\] Initial V12 version. Complete rewrite from v11. diff --git a/mail_debranding/readme/ROADMAP.md b/mail_debranding/readme/ROADMAP.md new file mode 100644 index 0000000..08bc7b2 --- /dev/null +++ b/mail_debranding/readme/ROADMAP.md @@ -0,0 +1,5 @@ +Known issues: + +- Not all branding is removed from auth_signup's invitation email + because it is a longer, more complex snippet of HTML. Only the line + containing the link to Odoo.com is removed. diff --git a/mail_debranding/readme/USAGE.md b/mail_debranding/readme/USAGE.md new file mode 100644 index 0000000..44e4351 --- /dev/null +++ b/mail_debranding/readme/USAGE.md @@ -0,0 +1,5 @@ +To use this module, you need to: + +- Install it. +- Send an email. +- Nobody will know it comes from Odoo. diff --git a/mail_debranding/static/description/icon.png b/mail_debranding/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..06a30af91980c5ae9d1dd04fb396e0bb723cdfc3 GIT binary patch literal 5367 zcmWky2Q=JG5dYulqMYFLE{IM-ba$K{T|_SlqW9?Jj))K?2_gEOC`pLUi4v#xD2d)n zIP&SjCECZnH#=|kw>$IO*|)RrZM>0z7BwX+B>(`_I@$=6D~-Gsa?-25L&b66N)ZRB z>6npUwFq*jmsd80ueN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kno|91Q&nfhS z1EJGVueMvZ6KZ=ea70gHFy1-B6`>4cEKr}CbAEruEosnp_~TH3nyHAhM@cuhK#1fb zYy9)TsISc#F>P6<`+^vk!flFmhaYty7?XqshWZSFgn_ij*i?b{tq_%%TVGfr&VU=3kA>F z_A0vuU+W_5NPeTIy;{h zq0Ex0aE&U$J)NS0vFtLGCsCJ?$cTKXjySG#el~r3CR`r0JsX_x$240~(rnY~y!@^e z2zaSt;0%H&o21=g8`+t(qzoGRT8!>PwG0i@SdNi7=TeOgK^ukVXKRzqLLeHq+k=G? zj3YjIhA#HkE^=N>JXbED&P}0N2$fkN3VMf0!AeO-u?8ZHQH(b)F-eTz8zkQJcri{b zb8rtO6;lZO=u^Rd{o{&0XwA&sElxD$s8+Q;Ts1UG9+{UQuGyn63ilZo)@qelL$^j5 zs2MH_JTlwAwda9l`gT{GJduIW*JEnIHR-V;fqRmb^-^W_BnDufC>&_Te7m%}9gk$( zqz)p(jf|Fuf)_dxO7>sC!cl!-XOLv$%LVZX?6*ttBpTEQ5=!FZ@ej-T1}ZwK_lf;^ z?Wy$;JfR2U%qFl`(`hWfz8}k4F literal 0 HcmV?d00001 diff --git a/mail_debranding/static/description/icon.svg b/mail_debranding/static/description/icon.svg new file mode 100644 index 0000000..6609694 --- /dev/null +++ b/mail_debranding/static/description/icon.svg @@ -0,0 +1,248 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mail_debranding/static/description/index.html b/mail_debranding/static/description/index.html new file mode 100644 index 0000000..c91d52b --- /dev/null +++ b/mail_debranding/static/description/index.html @@ -0,0 +1,484 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Mail Debrand

+ +

Production/Stable License: AGPL-3 OCA/server-brand Translate me on Weblate Try me on Runboat

+

This module modifies the functionality of emails to remove the Odoo +branding, specifically the ‘Powered by Odoo’

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  • Install it.
  • +
  • Send an email.
  • +
  • Nobody will know it comes from Odoo.
  • +
+
+
+

Known issues / Roadmap

+

Known issues:

+
    +
  • Not all branding is removed from auth_signup’s invitation email +because it is a longer, more complex snippet of HTML. Only the line +containing the link to Odoo.com is removed.
  • +
+
+
+

Changelog

+ +
+

12.0.1.0.0 (2018-11-06)

+
    +
  • [NEW] Initial V12 version. Complete rewrite from v11.
  • +
+
+
+
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
  • ForgeFlow
  • +
  • Onestein
  • +
  • Sodexis
  • +
  • Nexterp Romania
  • +
+
+
+

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.

+

Current maintainers:

+

pedrobaeza joao-p-marques

+

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

+

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

+
+
+
+
+ + diff --git a/mail_debranding/tests/__init__.py b/mail_debranding/tests/__init__.py new file mode 100644 index 0000000..8682c90 --- /dev/null +++ b/mail_debranding/tests/__init__.py @@ -0,0 +1,3 @@ +from . import test_mail_debrand +from . import test_mail_debrand_digest +from . import test_mail_debrand_signup diff --git a/mail_debranding/tests/test_mail_debrand.py b/mail_debranding/tests/test_mail_debrand.py new file mode 100644 index 0000000..c44ec6a --- /dev/null +++ b/mail_debranding/tests/test_mail_debrand.py @@ -0,0 +1,117 @@ +# Copyright 2017 Tecnativa - Pedro M. Baeza +# Copyright 2020 Onestein - Andrea Stirpe +# Copyright 2021-22 Sodexis +# Copyright 2021 Tecnativa - João Marques +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests import common + + +class TestMailDebrand(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.mail = cls.env["mail.mail"].create( + { + "email_from": "customer@example.com", + "subject": "Hello", + "email_to": "contact@example.com", + "reply_to": "contact@example.com", + } + ) + lang_nl = cls.env.ref("base.lang_nl") + if not lang_nl.active: + lang_nl.action_unarchive() + + def test_debrand_binary_value(self): + """ + Regression test: ensure binary input is gracefully handled + """ + try: + self.env["mail.template"].remove_href_odoo( + b"Binary value with more than 20 characters" + ) + except TypeError: + self.fail("Debranding binary string raised TypeError") + + def _test_debrand_by_lang(self, template_ref, lang, term): + body = self.env["ir.qweb"]._render( + template_ref, + { + "message": self.mail, + "company": self.env.company, + "email_notification_force_footer": True, + }, + lang=lang.code, + minimal_qcontext=True, + ) + self.assertIn(term, body) + body_cleaned = self.env["mail.render.mixin"].remove_href_odoo(body) + self.assertNotIn(term, body_cleaned) + + def test_default_debrand(self): + self._test_debrand_by_lang( + "mail.mail_notification_layout", + self.env.ref("base.lang_en"), + "Powered by", + ) + + def test_default_debrand_translated(self): + self._test_debrand_by_lang( + "mail.mail_notification_layout", + self.env.ref("base.lang_nl"), + "Aangeboden door", + ) + + def test_light_debrand(self): + self._test_debrand_by_lang( + "mail.mail_notification_light", + self.env.ref("base.lang_en"), + "Powered by", + ) + + def test_light_debrand_translated(self): + self._test_debrand_by_lang( + "mail.mail_notification_light", + self.env.ref("base.lang_nl"), + "Aangeboden door", + ) + + def test_body_intact(self): + """The message body should never be changed""" + MailMessage = self.env["mail.mail"] + original_body = ( + "

And if I send odoo.example.com

And odoo.com" + '

And https://odoo.com

And ' + 'https://odoo.example.com

' + ) + email_values = { + "email_from": "customer@example.com", + "subject": "Hello", + "email_to": "contact@example.com", + "reply_to": "contact@example.com", + "body": original_body, + "body_html": ( + "\n
\n\n\n

And if I send odoo.example.com

" + 'And odoo.com

And ' + 'https://odoo.com

And ' + "https://odoo.example.com

\n\n" + '
-- ' + '
\nAdministrator
\n' + '

\n Sent\n ' + '\n by\n \n ' + "YourCompany\n \n \n \n " + 'using\n Odoo' + ".\n

\n
\n " + ), + } + # No exception expected + message = MailMessage.create(email_values) + self.assertTrue(original_body in message._prepare_outgoing_body()) diff --git a/mail_debranding/tests/test_mail_debrand_digest.py b/mail_debranding/tests/test_mail_debrand_digest.py new file mode 100644 index 0000000..44fbfc2 --- /dev/null +++ b/mail_debranding/tests/test_mail_debrand_digest.py @@ -0,0 +1,71 @@ +# Copyright 2017 Tecnativa - Pedro M. Baeza +# Copyright 2020 Onestein - Andrea Stirpe +# Copyright 2021-22 Sodexis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from datetime import datetime + +from odoo.tests import common, tagged +from odoo.tools.urls import urljoin + + +@tagged("-at_install", "post_install") +class TestMailDebrandDigest(common.TransactionCase): + def setUp(self): + super().setUp() + if "digest.digest" in self.env: + self.mail_digest_id = self.env["digest.digest"].create( + { + "name": "Test Digest", + "user_ids": False, + "company_id": self.env.company.id, + "kpi_res_users_connected": True, + "kpi_mail_message_total": True, + } + ) + else: + self.mail_digest_id = False + + def test_mail_digest(self): + if not self.mail_digest_id: + self.assertEqual(True, True) + return + + web_base_url = self.env["ir.config_parameter"].sudo().get_param("web.base.url") + rendered_body = self.env["mail.render.mixin"]._render_template( + "digest.digest_mail_main", + "digest.digest", + self.mail_digest_id.ids, + engine="qweb_view", + add_context={ + "title": self.mail_digest_id.name, + "top_button_label": self.env._("Connect"), + "top_button_url": urljoin(web_base_url, "/web/login"), + "company": self.env.user.company_id, + "user": self.env.user, + "tips_count": 1, + "formatted_date": datetime.today().strftime("%B %d, %Y"), + "display_mobile_banner": True, + "kpi_data": self.mail_digest_id._compute_kpis( + self.env.user.company_id, self.env.user + ), + "tips": self.mail_digest_id._compute_tips( + self.env.user.company_id, self.env.user, tips_count=1, consumed=True + ), + "preferences": self.mail_digest_id._compute_preferences( + self.env.user.company_id, self.env.user + ), + }, + options={ + "post_process": True, + }, + )[self.mail_digest_id.id] + + # ensure the template rendered correctly. if rendering failed, + # we sometimes end up with a string only containing the template + # name, or a null-ish value + self.assertNotEqual(rendered_body, "digest.digest_mail_main") + self.assertNotEqual(rendered_body, None) + self.assertNotEqual(rendered_body, False) + self.assertNotEqual(rendered_body, "") + self.assertNotIn("Powered by", rendered_body) diff --git a/mail_debranding/tests/test_mail_debrand_signup.py b/mail_debranding/tests/test_mail_debrand_signup.py new file mode 100644 index 0000000..107f064 --- /dev/null +++ b/mail_debranding/tests/test_mail_debrand_signup.py @@ -0,0 +1,28 @@ +from odoo.tests import TransactionCase, tagged + + +@tagged("-at_install", "post_install") +class TestMailDebrandSignup(TransactionCase): + def _has_module(self): + module = self.env["ir.module.module"].search([("name", "=", "auth_signup")]) + self.assertTrue(module) + return module.state == "installed" + + def test_debrand_auth_signup_set_password_email(self): + if not self._has_module(): + return + template = self.env.ref( + "auth_signup.set_password_email", + ) + self.assertIn("www.odoo.com", template.body_html) + self.assertIn("Accept invitation", template.body_html) + self.assertIn("to discover the tool", template.body_html) + + mail_id = template.send_mail(self.env.user.id) + body = self.env["mail.mail"].browse(mail_id).body_html + + # The essential button is preserved + self.assertIn("Accept invitation", body) + # But at least part of the branding was removed + self.assertNotIn("www.odoo.com", body) + self.assertNotIn("to discover the tool", body)