Skip to content

[19.0][MIG] mail_restrict_follower_selection: Migration to 19.0#150

Open
muaazsiddiq wants to merge 47 commits intoOCA:19.0from
initOS:19.0-mig-mail_restrict_follower_selection
Open

[19.0][MIG] mail_restrict_follower_selection: Migration to 19.0#150
muaazsiddiq wants to merge 47 commits intoOCA:19.0from
initOS:19.0-mig-mail_restrict_follower_selection

Conversation

@muaazsiddiq
Copy link

No description provided.

hbrunn and others added 30 commits February 12, 2026 12:08
Currently translated at 100.0% (3 of 3 strings)

Translation: social-11.0/social-11.0-mail_restrict_follower_selection
Translate-URL: https://translation.odoo-community.org/projects/social-11-0/social-11-0-mail_restrict_follower_selection/fr/
Currently translated at 100.0% (3 of 3 strings)

Translation: social-11.0/social-11.0-mail_restrict_follower_selection
Translate-URL: https://translation.odoo-community.org/projects/social-11-0/social-11-0-mail_restrict_follower_selection/de/
Currently translated at 75.0% (3 of 4 strings)

Translation: social-13.0/social-13.0-mail_restrict_follower_selection
Translate-URL: https://translation.odoo-community.org/projects/social-13-0/social-13-0-mail_restrict_follower_selection/it/
When creating a record from a record from another model, the model is not in the context (`default_res_model` key). For example: creating an invoice from a sale order.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: social-14.0/social-14.0-mail_restrict_follower_selection
Translate-URL: https://translation.odoo-community.org/projects/social-14-0/social-14-0-mail_restrict_follower_selection/
Currently translated at 100.0% (7 of 7 strings)

Translation: social-14.0/social-14.0-mail_restrict_follower_selection
Translate-URL: https://translation.odoo-community.org/projects/social-14-0/social-14-0-mail_restrict_follower_selection/it/
1. Use forecreate=false in mail_restrict_follower_selection/data/ir_config_parameter.xml so that a deleted configuration is not recreated by a module update
2. Change the default domain to something less agressive
3. Add an example restriction restricting following a specific model
OCA-git-bot and others added 17 commits February 12, 2026 12:08
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: social-16.0/social-16.0-mail_restrict_follower_selection
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_restrict_follower_selection/
Currently translated at 100.0% (4 of 4 strings)

Translation: social-16.0/social-16.0-mail_restrict_follower_selection
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_restrict_follower_selection/it/
With this is change it is now possible to use the `ref` function
in the domain set in a parameter, allowing to include xmlids
in the domain.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: mail-18.0/mail-18.0-mail_restrict_follower_selection
Translate-URL: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_restrict_follower_selection/
Currently translated at 100.0% (4 of 4 strings)

Translation: mail-18.0/mail-18.0-mail_restrict_follower_selection
Translate-URL: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_restrict_follower_selection/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: mail-18.0/mail-18.0-mail_restrict_follower_selection
Translate-URL: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_restrict_follower_selection/
@muaazsiddiq muaazsiddiq mentioned this pull request Feb 15, 2026
33 tasks
Copy link
Member

@mathiasfrancke mathiasfrancke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coder review: Nothing to complain
Tests: Successfully tested

I found a minor problem: When entering an invalid domain such as "["name", "not like", "%non%"]", the Sales app becomes unusable

@@ -8,24 +8,25 @@


class TestMailRestrictFollowerSelection(TransactionCase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-19.0
Disable tracking by setting tracking_disable on the whole test env (eg: cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) ) or evaluate the use of BaseCommon as base test class if you need to setup company, currency, users and groups in a special way).

"mail.followers.edit"
]._mail_restrict_follower_selection_get_domain()
eval_domain = safe_eval(
str(domain), context={"ref": lambda str_id: _id_get(self.env, str_id)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use this to remove the utils.py file?

Suggested change
str(domain), context={"ref": lambda str_id: _id_get(self.env, str_id)}
str(domain), context={"ref": lambda str_id: self.env.ref(str_id).id}

test_condition = config["test_enable"] and not self.env.context.get(
"test_restrict_follower"
)
if test_condition or self.env.context.get("no_restrict_follower"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the test_condition because I've changed the default value in this commit? 516c7ad

Comment on lines +23 to +26
test_condition = config["test_enable"] and not self.env.context.get(
"test_restrict_follower"
)
if test_condition or self.env.context.get("no_restrict_follower"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we remove test_condition because I've changed the default value in this commit?
516c7ad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.