mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-19 02:52:08 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import dms_access_group
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# Copyright 2024 Tecnativa - Víctor Martínez
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class DmsAccessGroup(models.Model):
|
||||
_inherit = "dms.access.group"
|
||||
|
||||
role_ids = fields.Many2many(
|
||||
comodel_name="res.users.role",
|
||||
relation="dms_access_group_user_roles_rel",
|
||||
column1="gid",
|
||||
column2="rid",
|
||||
string="Roles",
|
||||
)
|
||||
|
||||
@api.depends("role_ids", "role_ids.users")
|
||||
def _compute_users(self):
|
||||
"""Add the corresponding depends and the users of the roles."""
|
||||
res = super()._compute_users()
|
||||
for record in self.filtered("role_ids"):
|
||||
users = record.users
|
||||
users |= record.mapped("role_ids.users")
|
||||
record.update({"users": users, "count_users": len(users)})
|
||||
return res
|
||||
Loading…
Add table
Add a link
Reference in a new issue