Dynamic groups

auth_dynamic_groups
REPOSITORY
REPOSITORYOCA/server-auth
GIT
GIThttps://github.com/OCA/server-auth.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-auth/tree/14.0/auth_dynamic_groups
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSoca-travis, Weblate, OCA-git-bot, KKamaa
WEBSITE
WEBSITEhttps://github.com/OCA/server-auth
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:40:55
ODOO DEPENDENCIES
ODOO DEPENDENCIES 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_groups_form res.groups field Inherits base.view_groups_form
Models touched (2)

New fields (2)
  • dynamic_group_condition Text
    help='The condition to be met for a user to be a member of this group. It is evaluated as python code at login time, you get `user` passed as a browse record' args: 'Condition'
  • is_dynamic Boolean
    args: 'Dynamic'
Public methods (3)
  • action_evaluate(self)
  • check_expression(self, expr, gd=None, ld=None, mode='eval', nocp=False, lb=False)
  • eval_dynamic_group_condition(self, uid=None)

New fields (0)

No new fields.

Public methods (1)
  • update_dynamic_groups(cls, uid, db)
    @classmethod
REPOSITORY
REPOSITORYOCA/server-auth
GIT
GIThttps://github.com/OCA/server-auth.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-auth/tree/11.0/auth_dynamic_groups
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSOCA Transbot, oca-travis, Weblate, OCA-git-bot
WEBSITE
WEBSITEhttps://github.com/OCA/server-auth
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:23:56
ODOO DEPENDENCIES
ODOO DEPENDENCIES 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_groups_form res.groups field Inherits base.view_groups_form
Models touched (2)

New fields (2)
  • dynamic_group_condition Text
    help='The condition to be met for a user to be a member of this group. It is evaluated as python code at login time, you get `user` passed as a browse record' args: 'Condition'
  • is_dynamic Boolean
    args: 'Dynamic'
Public methods (2)
  • action_evaluate(self)
    @api.multi
  • eval_dynamic_group_condition(self, uid=None)
    @api.multi

New fields (0)

No new fields.

Public methods (1)
  • update_dynamic_groups(self, uid, db)
    @classmethod
REPOSITORY
REPOSITORYOCA/server-auth
GIT
GIThttps://github.com/OCA/server-auth.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-auth/tree/10.0/auth_dynamic_groups
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSHolger Brunn, OCA Transbot, oca-travis, Weblate, OCA-git-bot
WEBSITE
WEBSITEhttps://github.com/OCA/server-auth
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:19:55
ODOO DEPENDENCIES
ODOO DEPENDENCIES 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_groups_form res.groups field Inherits base.view_groups_form
Models touched (2)

New fields (2)
  • dynamic_group_condition Text
    help='The condition to be met for a user to be a member of this group. It is evaluated as python code at login time, you get `user` passed as a browse record' args: 'Condition'
  • is_dynamic Boolean
    args: 'Dynamic'
Public methods (2)
  • action_evaluate(self)
    @api.multi
  • eval_dynamic_group_condition(self, uid=None)
    @api.multi

New fields (0)

No new fields.

Public methods (1)
  • update_dynamic_groups(self, uid, db)
    @classmethod
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/9.0/auth_dynamic_groups
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTherp BV
MAINTAINERS
MAINTAINERSTherp BV
COMMITTERS
COMMITTERSPedro M. Baeza
WEBSITE
WEBSITE
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:15:22
ODOO DEPENDENCIES
ODOO DEPENDENCIES 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_groups_form res.groups data Inherits base.view_groups_form
Models touched (2)

New fields (2)
  • dynamic_group_condition Text
    help='The condition to be met for a user to be a member of this group. It is evaluated as python code at login time, you get `user` passed as a browse record' args: 'Condition'
  • is_dynamic Boolean
    args: 'Dynamic'
Public methods (2)
  • action_evaluate(self)
    @api.multi
  • eval_dynamic_group_condition(self, uid=None)
    @api.multi

New fields (0)

No new fields.

Public methods (1)
  • update_dynamic_groups(self, uid, db)
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/8.0/auth_dynamic_groups
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSStéphane Bidoul, Yannick Vaucher, Alexandre Fayolle, Holger Brunn, Stéphane Bidoul (ACSONE), OCA Transbot, Stefan Rijnhart (Opener), oca-travis, Weblate
WEBSITE
WEBSITE
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:11:25
ODOO DEPENDENCIES
ODOO DEPENDENCIES 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_groups_form res.groups data Inherits base.view_groups_form
Models touched (2)

New fields (2)
  • dynamic_group_condition Text
    help='The condition to be met for a user to be a member of this group. It is evaluated as python code at login time, you get `user` passed as a browse record' args: 'Condition'
  • is_dynamic Boolean
    args: 'Dynamic'
Public methods (2)
  • action_evaluate(self)
    @api.multi
  • eval_dynamic_group_condition(self, uid=None)
    @api.multi

New fields (0)

No new fields.

Public methods (1)
  • update_dynamic_groups(self, uid, db)
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/6.1/auth_dynamic_groups
VERSION
VERSION 1.0
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSHolger Brunn
WEBSITE
WEBSITE
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:04:06
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
Description
-----------
This module allows defining groups whose membership is a condition expressed as
python code. For every user, it is evaluated during login if she belongs to
the group or not.

Usage
-----
Check `Dynamic` on a group you want to be dynamic. Now fill in the condition,
using `user` which is a browse record of the user in question that evaluates
truthy if the user is supposed to be a member of the group and falsy if not.

There is a constraint on the field to check for validity if this expression.
When you're satisfied, click the button `Evaluate` to prefill the group's
members. The condition will be checked now for every user who logs in.

Example
-------
We have a group called `Amsterdam` and want it to contain all users from
city of Amsterdam. So we use the membership condition

```
user.partner_id.city == 'Amsterdam'
```

Now we can be sure every user living in this city is in the right group, and we
can start assigning local menus to it, adjust permissions, etc.
    

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
view_groups_form res.groups data Inherits base.view_groups_form
Models touched (2)

New fields (0)

No new fields.

Public methods (2)
  • action_evaluate(self, cr, uid, ids, context=None)
  • eval_dynamic_group_condition(self, cr, uid, ids, context=None)

New fields (0)

No new fields.

Public methods (2)
  • login(self, db, login, password)
  • update_dynamic_groups(self, uid, db)