Skip to content

[19.0][MIG] default_multi_user: Migration to 19.0#1296

Open
dnplkndll wants to merge 13 commits into
OCA:19.0from
ledoent:19.0-mig-default_multi_user
Open

[19.0][MIG] default_multi_user: Migration to 19.0#1296
dnplkndll wants to merge 13 commits into
OCA:19.0from
ledoent:19.0-mig-default_multi_user

Conversation

@dnplkndll

Copy link
Copy Markdown

Port of default_multi_user from 18.0 to 19.0 (migration guide).

Non-mechanical adaptations worth flagging

  • res.groups.users was renamed to res.groups.user_ids in 19.0 (the privilege
    refactor). _compute_user_ids referenced the old name — left unfixed it raises
    AttributeError at compute time. The module's own group_ids/user_ids fields
    on ir.default are unrelated and unchanged.
  • The post_load monkeypatch of ir.default._get_model_defaults is preserved as-is:
    19.0 core keeps the method signature, the @ormcache keys, flush_model(), and
    the json_value/user_id/company_id/condition columns the custom SQL relies on,
    so the override remains compatible.

@OCA-git-bot OCA-git-bot added series:19.0 mod:default_multi_user Module default_multi_user labels May 29, 2026

@baptiste-n42 baptiste-n42 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, just two things unrelated to the migration but worth flagging 👍

from odoo import api, fields, models


class IrDefaultgard(models.Model):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@baptiste-n42 baptiste-n42 mentioned this pull request Jun 15, 2026
30 tasks
LoisRForgeFlow and others added 9 commits June 22, 2026 14:46
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>
@dnplkndll dnplkndll force-pushed the 19.0-mig-default_multi_user branch from a06f9f3 to 5de84d3 Compare June 22, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:default_multi_user Module default_multi_user series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants