mirror of
https://github.com/bringout/oca-dms.git
synced 2026-04-21 01:42:05 +02:00
Add oca-dms submodule with 10 DMS modules
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c674eb0508
commit
ae2c6775ba
569 changed files with 63341 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