diff --git a/mail_autosubscribe/README.rst b/mail_autosubscribe/README.rst index 01fed9861..115628345 100644 --- a/mail_autosubscribe/README.rst +++ b/mail_autosubscribe/README.rst @@ -7,7 +7,7 @@ Mail Autosubscribe !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:25398ac084bbb538cdf42cf20ec03b2502919a3ce4fcd7f865bd23cf7d0ca09f + !! source digest: sha256:a5279d5605d3a20ab78296c3e833a9158bd7048178fae2d9b543abb8b1ddf1a1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/mail_autosubscribe/__manifest__.py b/mail_autosubscribe/__manifest__.py index 5c0c9100f..519a4aebf 100644 --- a/mail_autosubscribe/__manifest__.py +++ b/mail_autosubscribe/__manifest__.py @@ -10,9 +10,6 @@ "license": "AGPL-3", "category": "Marketing", "depends": ["mail"], - "external_dependencies": { - "python": ["odoo_test_helper"], - }, "website": "https://github.com/OCA/social", "data": [ "security/ir.model.access.csv", diff --git a/mail_autosubscribe/models/models.py b/mail_autosubscribe/models/models.py index 77f1a5d88..3c12b483e 100644 --- a/mail_autosubscribe/models/models.py +++ b/mail_autosubscribe/models/models.py @@ -3,6 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, models +from odoo.tools import config class BaseModel(models.AbstractModel): @@ -24,7 +25,10 @@ class BaseModel(models.AbstractModel): # Overload to include auto follow document partners in the composer # Note: This only works if the template is configured with 'Default recipients' res = super()._message_get_default_recipients() - if self.env.context.get("no_autosubscribe_followers"): + test_condition = config["test_enable"] and not self.env.context.get( + "test_mail_autosubscribe" + ) + if test_condition or self.env.context.get("no_autosubscribe_followers"): return res for rec in self: partner_ids = res[rec.id]["partner_ids"] diff --git a/mail_autosubscribe/static/description/index.html b/mail_autosubscribe/static/description/index.html index bf6471d8d..8194ed7b0 100644 --- a/mail_autosubscribe/static/description/index.html +++ b/mail_autosubscribe/static/description/index.html @@ -1,3 +1,4 @@ + @@ -366,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:25398ac084bbb538cdf42cf20ec03b2502919a3ce4fcd7f865bd23cf7d0ca09f +!! source digest: sha256:a5279d5605d3a20ab78296c3e833a9158bd7048178fae2d9b543abb8b1ddf1a1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/social Translate me on Weblate Try me on Runboat

This module allows you to configure partners that will be automatically in copy diff --git a/mail_autosubscribe/tests/test_mail_autosubscribe.py b/mail_autosubscribe/tests/test_mail_autosubscribe.py index 27969c827..f3381c1ed 100644 --- a/mail_autosubscribe/tests/test_mail_autosubscribe.py +++ b/mail_autosubscribe/tests/test_mail_autosubscribe.py @@ -13,7 +13,11 @@ class TestMailAutosubscribe(TransactionCase): def setUpClass(cls): super().setUpClass() # Setup env - cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + cls.env = cls.env( + context=dict( + cls.env.context, tracking_disable=True, test_mail_autosubscribe=True + ) + ) # Load fake order model cls.loader = FakeModelLoader(cls.env, cls.__module__) cls.loader.backup_registry() diff --git a/requirements.txt b/requirements.txt index 2b7ec57df..e4ecac191 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ # generated from manifests external_dependencies cryptography<37 extract_msg -odoo_test_helper diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000..4ad8e0ece --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo-test-helper