diff --git a/mail_partner_opt_out/README.rst b/mail_partner_opt_out/README.rst new file mode 100644 index 000000000..5a5857a9f --- /dev/null +++ b/mail_partner_opt_out/README.rst @@ -0,0 +1,101 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +==================== +Mail Partner Opt Out +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:ad64242eff6365d70a866ae459a1da1d5bfe0406d3ad017cf19df961740f7fd9 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github + :target: https://github.com/OCA/mail/tree/19.0/mail_partner_opt_out + :alt: OCA/mail +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/mail-19-0/mail-19-0-mail_partner_opt_out + :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/mail&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds the capability for a user to add a partner's email +address to the blackmail list so that she will not receive any emails +from mass mailing campaigns + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Go to a partner. Next to the partner's email address you will see a plus +symbol. Once you press it the partner's email address will be +blacklisted and then a ban will appear. If you click that ban the email +address will be removed from the blacklist. + +You can also filter for the Blacklist attribute, to see all the +partner's that their email has been added to the blacklist. + +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 +------- + +* ForgeFlow + +Contributors +------------ + +- ForgeFlow, S.L. (contact@forgeflow.com) + + - Jordi Ballester Alomar (jordi.ballester@forgeflow.com) + +Other credits +------------- + +The migration of this module from 18.0 to 19.0 was financially supported +by Agent ERP GmbH + +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. + +This module is part of the `OCA/mail `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_partner_opt_out/__init__.py b/mail_partner_opt_out/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/mail_partner_opt_out/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mail_partner_opt_out/__manifest__.py b/mail_partner_opt_out/__manifest__.py new file mode 100644 index 000000000..fa33190d4 --- /dev/null +++ b/mail_partner_opt_out/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2021 ForgeFlow S.L. +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). +{ + "name": "Mail Partner Opt Out", + "summary": "Add the partner's email to the blackmailed list", + "version": "19.0.1.0.0", + "development_status": "Beta", + "category": "Social Network", + "website": "https://github.com/OCA/mail", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "license": "LGPL-3", + "installable": True, + "data": ["views/res_partner_views.xml"], + "depends": ["mail"], +} diff --git a/mail_partner_opt_out/i18n/it.po b/mail_partner_opt_out/i18n/it.po new file mode 100644 index 000000000..f4700ffb4 --- /dev/null +++ b/mail_partner_opt_out/i18n/it.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_partner_opt_out +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-12-01 10:12+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 4.17\n" + +#. module: mail_partner_opt_out +#: model_terms:ir.ui.view,arch_db:mail_partner_opt_out.res_partner_view_form_inherit_mail +msgid "Click to add this email to the blacklist." +msgstr "Fare clic per aggiungere questa e-mail alla blacklist." + +#. module: mail_partner_opt_out +#: model:ir.model,name:mail_partner_opt_out.model_mail_thread_blacklist +msgid "Mail Blacklist mixin" +msgstr "Mixin blacklist e-mail" diff --git a/mail_partner_opt_out/i18n/mail_partner_opt_out.pot b/mail_partner_opt_out/i18n/mail_partner_opt_out.pot new file mode 100644 index 000000000..911575ae3 --- /dev/null +++ b/mail_partner_opt_out/i18n/mail_partner_opt_out.pot @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_partner_opt_out +# +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_partner_opt_out +#: model_terms:ir.ui.view,arch_db:mail_partner_opt_out.res_partner_view_form_inherit_mail +msgid "Click to add this email to the blacklist." +msgstr "" + +#. module: mail_partner_opt_out +#: model:ir.model,name:mail_partner_opt_out.model_mail_thread_blacklist +msgid "Mail Blacklist mixin" +msgstr "" diff --git a/mail_partner_opt_out/models/__init__.py b/mail_partner_opt_out/models/__init__.py new file mode 100644 index 000000000..32620734a --- /dev/null +++ b/mail_partner_opt_out/models/__init__.py @@ -0,0 +1 @@ +from . import mail_thread_blacklist diff --git a/mail_partner_opt_out/models/mail_thread_blacklist.py b/mail_partner_opt_out/models/mail_thread_blacklist.py new file mode 100644 index 000000000..9bbca0221 --- /dev/null +++ b/mail_partner_opt_out/models/mail_thread_blacklist.py @@ -0,0 +1,10 @@ +from odoo import models + + +class MailBlackListMixin(models.AbstractModel): + _inherit = "mail.thread.blacklist" + + def mail_blacklist_add(self): + for mail_thread_blacklist in self: + if not mail_thread_blacklist.is_blacklisted and mail_thread_blacklist.email: + self.env["mail.blacklist"].sudo()._add(mail_thread_blacklist.email) diff --git a/mail_partner_opt_out/pyproject.toml b/mail_partner_opt_out/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/mail_partner_opt_out/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/mail_partner_opt_out/readme/CONTRIBUTORS.md b/mail_partner_opt_out/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..c000c3042 --- /dev/null +++ b/mail_partner_opt_out/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- ForgeFlow, S.L. () + + > - Jordi Ballester Alomar () diff --git a/mail_partner_opt_out/readme/CREDITS.md b/mail_partner_opt_out/readme/CREDITS.md new file mode 100644 index 000000000..5576cefe6 --- /dev/null +++ b/mail_partner_opt_out/readme/CREDITS.md @@ -0,0 +1 @@ +The migration of this module from 18.0 to 19.0 was financially supported by Agent ERP GmbH diff --git a/mail_partner_opt_out/readme/DESCRIPTION.md b/mail_partner_opt_out/readme/DESCRIPTION.md new file mode 100644 index 000000000..b06ac0afd --- /dev/null +++ b/mail_partner_opt_out/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module adds the capability for a user to add a partner's email +address to the blackmail list so that she will not receive any emails +from mass mailing campaigns diff --git a/mail_partner_opt_out/readme/USAGE.md b/mail_partner_opt_out/readme/USAGE.md new file mode 100644 index 000000000..4235c8740 --- /dev/null +++ b/mail_partner_opt_out/readme/USAGE.md @@ -0,0 +1,7 @@ +Go to a partner. Next to the partner's email address you will see a plus +symbol. Once you press it the partner's email address will be +blacklisted and then a ban will appear. If you click that ban the email +address will be removed from the blacklist. + +You can also filter for the Blacklist attribute, to see all the +partner's that their email has been added to the blacklist. diff --git a/mail_partner_opt_out/static/description/icon.png b/mail_partner_opt_out/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/mail_partner_opt_out/static/description/icon.png differ diff --git a/mail_partner_opt_out/static/description/index.html b/mail_partner_opt_out/static/description/index.html new file mode 100644 index 000000000..629c330a9 --- /dev/null +++ b/mail_partner_opt_out/static/description/index.html @@ -0,0 +1,453 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Mail Partner Opt Out

+ +

Beta License: LGPL-3 OCA/mail Translate me on Weblate Try me on Runboat

+

This module adds the capability for a user to add a partner’s email +address to the blackmail list so that she will not receive any emails +from mass mailing campaigns

+

Table of contents

+ +
+

Usage

+

Go to a partner. Next to the partner’s email address you will see a plus +symbol. Once you press it the partner’s email address will be +blacklisted and then a ban will appear. If you click that ban the email +address will be removed from the blacklist.

+

You can also filter for the Blacklist attribute, to see all the +partner’s that their email has been added to the blacklist.

+
+
+

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

+
    +
  • ForgeFlow
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 18.0 to 19.0 was financially supported +by Agent ERP GmbH

+
+
+

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/mail project on GitHub.

+

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

+
+
+
+
+ + diff --git a/mail_partner_opt_out/tests/__init__.py b/mail_partner_opt_out/tests/__init__.py new file mode 100644 index 000000000..45d9e4b2e --- /dev/null +++ b/mail_partner_opt_out/tests/__init__.py @@ -0,0 +1 @@ +from . import test_mail_partner_opt_out diff --git a/mail_partner_opt_out/tests/test_mail_partner_opt_out.py b/mail_partner_opt_out/tests/test_mail_partner_opt_out.py new file mode 100644 index 000000000..c739283ab --- /dev/null +++ b/mail_partner_opt_out/tests/test_mail_partner_opt_out.py @@ -0,0 +1,21 @@ +# Copyright 2025 Onestein - Anjeel Haria +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.addons.base.tests.common import BaseCommon + + +class TestMailPartnerOptOut(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.partner = cls.env["res.partner"].create( + [{"name": "Mr. Odoo", "email": "mrodoo@xyz.com"}] + ) + + def test_mail_blacklist_add(self): + self.partner.mail_blacklist_add() + self.assertTrue( + self.env["mail.blacklist"].search( + [("email", "=", "mrodoo@xyz.com")], limit=1 + ) + ) diff --git a/mail_partner_opt_out/views/res_partner_views.xml b/mail_partner_opt_out/views/res_partner_views.xml new file mode 100644 index 000000000..cdc0989ed --- /dev/null +++ b/mail_partner_opt_out/views/res_partner_views.xml @@ -0,0 +1,20 @@ + + + + res.partner.view.form.inherit.mail + res.partner + + + +