[19.0][MIG] mail_restrict_follower_selection: Migration to 19.0#150
[19.0][MIG] mail_restrict_follower_selection: Migration to 19.0#150muaazsiddiq wants to merge 47 commits intoOCA:19.0from
Conversation
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/
that you are not supposed to.
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
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/
…follower selection
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/
mathiasfrancke
left a comment
There was a problem hiding this comment.
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): | |||
There was a problem hiding this comment.
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)} |
There was a problem hiding this comment.
Can't we use this to remove the utils.py file?
| 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"): |
There was a problem hiding this comment.
Can we remove the test_condition because I've changed the default value in this commit? 516c7ad
| 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"): |
There was a problem hiding this comment.
Can't we remove test_condition because I've changed the default value in this commit?
516c7ad
No description provided.