User roles by company

base_user_role_company
REPOSITORY
REPOSITORYOCA/server-backend
GIT
GIThttps://github.com/OCA/server-backend.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-backend/tree/18.0/base_user_role_company
VERSION
VERSION 1.0.2
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Open Source Integrators
MAINTAINERS
MAINTAINERSdreispt
COMMITTERS
COMMITTERSGitHub, Weblate, OCA-git-bot, oca-ci, Maksym Yankin, tom.vermeeren
WEBSITE
WEBSITEhttps://github.com/OCA/server-backend
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:20
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/server-backend:
    - base_user_role
odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
Enable User Roles depending on the Companies selected.

A company specific Role will only be enabled if it is set for **all**
the currently selected companies.

For example, if a user is "Sales Manager" only for Company A, it will
see that role enabled only if Company A is selected. If the user selects
Company A and Company B, then the "Sales Manager" role won't be enabled.

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_res_users_form_inherit res.users.form.inherit res.users field Inherits base_user_role.view_res_users_form_inherit
view_res_users_form_inherit_company res.users.form.inherit.company res.users field Inherits base_user_role.view_res_users_form_inherit
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • session_info(self)
    Based on the selected companies (cids), calculate the roles to enable. A role should be enabled only when it applies to all selected companies.

New fields (0)

No new fields.

Public methods (1)
  • authenticate(cls, db, credential, user_agent_env)
    @classmethod

New fields (2)
  • allowed_company_ids Many2many
    related='user_id.company_ids'
  • company_id Many2one → res.company
    domain="[('id', 'in', allowed_company_ids)]" help='If set, this role only applies when this is the main company selected. Otherwise it applies to all companies.' args: 'res.company', 'Company'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/server-backend
GIT
GIThttps://github.com/OCA/server-backend.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-backend/tree/17.0/base_user_role_company
VERSION
VERSION 1.2.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLEYes
AUTHORS
AUTHORSOdoo Community Association (OCA), Open Source Integrators
MAINTAINERS
MAINTAINERSdreispt
COMMITTERS
COMMITTERSPedro M. Baeza, OCA-git-bot, oca-ci, David Ramia, Jérémy Didderen, Robin Conjour, Benoît Fontaine
WEBSITE
WEBSITEhttps://github.com/OCA/server-backend
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:20:11
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/server-backend:
    - base_user_role
odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
Enable User Roles depending on the Companies selected.

A company specific Role will only be enabled if it is set for **all**
the currently selected companies.

For example, if a user is "Sales Manager" only for Company A, it will
see that role enabled only if Company A is selected. If the user selects
Company A and Company B, then the "Sales Manager" role won't be enabled.

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_res_users_form_inherit res.users.form.inherit res.users field Inherits base_user_role.view_res_users_form_inherit
view_res_users_form_inherit_company res.users.form.inherit.company res.users field Inherits base_user_role.view_res_users_form_inherit
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • session_info(self)
    Based on the selected companies (cids), calculate the roles to enable. A role should be enabled only when it applies to all selected companies.

New fields (0)

No new fields.

Public methods (1)
  • authenticate(cls, db, login, password, user_agent_env)
    @classmethod

New fields (2)
  • allowed_company_ids Many2many
    related='user_id.company_ids'
  • company_id Many2one → res.company
    domain="[('id', 'in', allowed_company_ids)]" help='If set, this role only applies when this is the main company selected. Otherwise it applies to all companies.' args: 'res.company', 'Company'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/server-backend
GIT
GIThttps://github.com/OCA/server-backend.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-backend/tree/16.0/base_user_role_company
VERSION
VERSION 1.2.2
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Open Source Integrators
MAINTAINERS
MAINTAINERSdreispt
COMMITTERS
COMMITTERSSylvain LE GAL, Enric Tobella, Sébastien Alix, Weblate, OCA-git-bot, Benjamin Willig, oca-ci, Jérémy Didderen, Urvisha-OSI
WEBSITE
WEBSITEhttps://github.com/OCA/server-backend
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:54:00
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/server-backend:
    - base_user_role
odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_res_users_form_inherit res.users.form.inherit res.users field Inherits base_user_role.view_res_users_form_inherit
view_res_users_form_inherit_company res.users.form.inherit.company res.users field Inherits base_user_role.view_res_users_form_inherit
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • session_info(self)
    Based on the selected companies (cids), calculate the roles to enable. A role should be enabled only when it applies to all selected companies.

New fields (0)

No new fields.

Public methods (1)
  • authenticate(cls, db, login, password, user_agent_env)
    @classmethod

New fields (2)
  • allowed_company_ids Many2many
    related='user_id.company_ids'
  • company_id Many2one → res.company
    domain="[('id', 'in', allowed_company_ids)]" help='If set, this role only applies when this is the main company selected. Otherwise it applies to all companies.' args: 'res.company', 'Company'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/server-backend
GIT
GIThttps://github.com/OCA/server-backend.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-backend/tree/14.0/base_user_role_company
VERSION
VERSION 2.0.2
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLEYes
AUTHORS
AUTHORSOdoo Community Association (OCA), Open Source Integrators
MAINTAINERS
MAINTAINERSdreispt
COMMITTERS
COMMITTERSDaniel Reis, Andrii Skrypka, OCA Transbot, oca-travis, Weblate, OCA-git-bot, Jérémy Didderen
WEBSITE
WEBSITEhttps://github.com/OCA/server-backend
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:41:12
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/server-backend:
    - base_user_role
odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
view_res_users_form_inherit_company res.users.form.inherit.company res.users field Inherits base_user_role.view_res_users_form_inherit
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • session_info(self)
    Based on the selected companies (cids), calculate the roles to enable. A role should be enabled only when it applies to all selected companies.

New fields (0)

No new fields.

Public methods (1)
  • authenticate(cls, db, login, password, user_agent_env)
    @classmethod

New fields (2)
  • allowed_company_ids Many2many
    related='user_id.company_ids'
  • company_id Many2one → res.company
    domain="[('id', 'in', allowed_company_ids)]" help='If set, this role only applies when this is the main company selected. Otherwise it applies to all companies.' args: 'res.company', 'Company'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/server-backend
GIT
GIThttps://github.com/OCA/server-backend.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-backend/tree/12.0/base_user_role_company
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLEYes
AUTHORS
AUTHORSOdoo Community Association (OCA), Open Source Integrators
MAINTAINERS
MAINTAINERSdreispt
COMMITTERS
COMMITTERSHolger Brunn, OCA Transbot, oca-travis, Weblate, OCA-git-bot
WEBSITE
WEBSITEhttps://github.com/OCA/server-backend
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:29:25
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/server-backend:
    - base_user_role
odoo/odoo:
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
view_res_users_form_inherit_company res.users.form.inherit.company res.users field Inherits base_user_role.view_res_users_form_inherit
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • session_info(self)
    Based on the selected companies (cids), calculate the roles to enable. A role should be enabled only when it applies to all selected companies.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (2)
  • active_role Boolean
    default=True string='Active Role'
  • company_id Many2one → res.company
    help='If set, this role only applies when this is the main company selected. Otherwise it applies to all companies.' args: 'res.company', 'Company'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/10.0/base_user_role_company
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLEYes
AUTHORS
AUTHORSOdoo Community Association (OCA), Open Source Integrators
MAINTAINERS
MAINTAINERSdreispt
COMMITTERS
COMMITTERSHolger Brunn, oca-travis, OCA-git-bot
WEBSITE
WEBSITEhttps://github.com/OCA/server-backend
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:20:00
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/server-tools:
    - base_user_role
odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
view_res_users_form_inherit_company res.users.form.inherit.company res.users field Inherits base_user_role.view_res_users_form_inherit
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • session_info(self)
    Based on the selected companies (cids), calculate the roles to enable. A role should be enabled only when it applies to all selected companies.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (2)
  • active_role Boolean
    default=True string='Active Role'
  • company_id Many2one → res.company
    help='If set, this role only applies when this is the main company selected. Otherwise it applies to all companies.' args: 'res.company', 'Company'
Public methods (0)

No public methods.

STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/server-backend
PULL REQUEST
PULL REQUEST[19.0][MIG] base_user_role_company: Migration to 19.0 (#445)
STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/server-backend
PULL REQUEST
PULL REQUEST[19.0][MIG] base_user_role_company: Migration to 19.0 (#383)