mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[IMP] base_user_role: Adding alert in user when role is used
This commit is contained in:
committed by
Bert Van Groenendael
parent
45dc547a01
commit
795eb44efd
@@ -12,6 +12,14 @@ class ResUsers(models.Model):
|
||||
string="Role lines",
|
||||
default=lambda self: self._default_role_lines(),
|
||||
)
|
||||
|
||||
show_alert = fields.Boolean(compute="_compute_show_alert")
|
||||
|
||||
@api.depends("role_line_ids")
|
||||
def _compute_show_alert(self):
|
||||
for user in self:
|
||||
user.show_alert = user.role_line_ids.filtered(lambda rec: rec.is_enabled)
|
||||
|
||||
role_ids = fields.One2many(
|
||||
comodel_name="res.users.role",
|
||||
string="Roles",
|
||||
|
||||
Reference in New Issue
Block a user