Skip to content

[19.0][ADD] res_company_admin_sync: keep system administrators assigned to every company#1025

Open
mikecolangelo wants to merge 1 commit into
OCA:19.0from
CanariasConectada:19.0-add-res_company_admin_sync
Open

[19.0][ADD] res_company_admin_sync: keep system administrators assigned to every company#1025
mikecolangelo wants to merge 1 commit into
OCA:19.0from
CanariasConectada:19.0-add-res_company_admin_sync

Conversation

@mikecolangelo

Copy link
Copy Markdown

New module: res_company_admin_sync

In a multi-company database, nothing keeps administrators' company assignments in sync with the companies that exist:

  • a company created after the administrator never lands in their company_ids, so it never shows up in their company switcher;
  • a user promoted to administrator keeps whatever partial assignment they had.

We audited a real ~270-company production database: every single administrator had accumulated gaps — up to 31 active companies missing each, including the most recently created ones. The administrators technically retained access through base.group_erp_manager exemptions, but the company switcher (which only lists company_ids) made those companies effectively unreachable in the UI.

This module grants automatically instead:

  • creating a company adds it to every base.group_system user's companies;
  • granting base.group_system adds every existing company to the new administrator.

Deliberately one-way (it never revokes): removing companies on demotion could silently strip access the user still legitimately needs, so trimming is left as an explicit administrative action.

Only depends on base. 4 tests, green on a fresh vanilla Odoo 19 install with only this module.

…every company

In a multi-company database, nothing keeps administrators' company
assignments in sync with the companies that exist: a company created
after the administrator misses from their company_ids (so it never shows
in their company switcher), and a user promoted to administrator keeps
whatever partial assignment they had. Audited on a real ~270-company
production database: every administrator had accumulated gaps, up to 31
active companies missing each, including the most recently created ones.

Grant automatically instead: creating a company adds it to every
base.group_system user's companies, and granting base.group_system adds
every existing company to the new administrator. Deliberately one-way
(it never revokes): removing companies on demotion could silently strip
access the user still legitimately needs, so trimming is left as an
explicit administrative action.
@OCA-git-bot OCA-git-bot added series:19.0 mod:res_company_admin_sync Module res_company_admin_sync labels Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:res_company_admin_sync Module res_company_admin_sync series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants