[19.0][MIG] default_multi_user: Migration to 19.0#1296
Open
dnplkndll wants to merge 13 commits into
Open
Conversation
baptiste-n42
approved these changes
Jun 15, 2026
baptiste-n42
left a comment
There was a problem hiding this comment.
LGTM, just two things unrelated to the migration but worth flagging 👍
| from odoo import api, fields, models | ||
|
|
||
|
|
||
| class IrDefaultgard(models.Model): |
There was a problem hiding this comment.
Not related to the migration PR but could be good to fix
Suggested change
| class IrDefaultgard(models.Model): | |
| class IrDefaultGuard(models.Model): |
| string="Available for Groups", | ||
| ) | ||
|
|
||
| @api.constrains("manual_user_ids", "group_ids") |
There was a problem hiding this comment.
Suggested change
| @api.constrains("manual_user_ids", "group_ids") | |
| @api.depends("manual_user_ids", "group_ids") |
Also not linked but could be a good fix as user_ids is stored computed field, but the method is decorated with @api.constrains instead of @api.depends.
This only recomputes when groups are added/removed from the default record itself.
It does not recompute when a user joins or leaves one of those groups
is incorrect to relay in the company_id field in the res_users table, we should use environment company instead.
This was fixed upstream but the signature of the method never got updated here in the corresponding hook.
Signed-off-by: Don Kendall <dkendall@ledoweb.com>
- res.users m2m: groups_id → group_ids (19.0 res.groups privilege refactor). - res.groups.users → res.groups.user_ids (inverse renamed in 19.0); fixes the _compute_user_ids AttributeError the rename would otherwise raise. Signed-off-by: Don Kendall <dkendall@ledoweb.com>
a06f9f3 to
5de84d3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of
default_multi_userfrom 18.0 to 19.0 (migration guide).Non-mechanical adaptations worth flagging
res.groups.userswas renamed tores.groups.user_idsin 19.0 (the privilegerefactor).
_compute_user_idsreferenced the old name — left unfixed it raisesAttributeErrorat compute time. The module's owngroup_ids/user_idsfieldson
ir.defaultare unrelated and unchanged.post_loadmonkeypatch ofir.default._get_model_defaultsis preserved as-is:19.0 core keeps the method signature, the
@ormcachekeys,flush_model(), andthe
json_value/user_id/company_id/conditioncolumns the custom SQL relies on,so the override remains compatible.