Skip to content

[19.0] base_user_role: migration to Odoo 19 (privileges, constraints, group_ids, view fixes) — request branch #378

@heyagent

Description

@heyagent

Hi OCA,

We’ve completed an Odoo 19 migration for base_user_role and would like to open a PR. Could you please create the 19.0 branch on this repository so we can submit it?

Summary of changes applied during the migration to 19.0:

  • Replace removed res.groups.category_id usage with the new privilege model:
    • Add a res.groups.privilege record “User roles” and link it to the ir.module.category “User roles”.
    • In res.users.role, introduce group_privilege_id (related to group_id.privilege_id).
    • Keep group_category_id as a read‑only related to the privilege’s category_id for display and grouping in the UI.
    • Ensure newly created roles default their inherited group’s privilege_id to the module’s “User roles” privilege.
  • Update constraint API:
    • Replace deprecated _sql_constraints with models.Constraint for the unique (user_id, role_id) on res.users.role.line.
  • Update role→group computation and user group syncing:
    • Use all_implied_ids (transitive closure) on groups as per v19.
    • Use group_ids (not groups_id) everywhere when setting user groups.
  • Adjust views to v19 structure:
    • The users list view no longer has company_id; insert the role tags after the login column instead.

Files touched in the migration include (module paths):

  • OCA/base_user_role/models/role.py
  • OCA/base_user_role/models/user.py
  • OCA/base_user_role/views/user.xml
  • OCA/base_user_role/data/ir_module_category.xml

Once the 19.0 branch is available, I’ll open a PR with these changes.

Thanks!

— Milan Topuzov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions