mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[IMP] base_user_role: UX improvements
This commit is contained in:
@@ -96,6 +96,13 @@ class ResUsersRoleLine(models.Model):
|
||||
date_from = fields.Date("From")
|
||||
date_to = fields.Date("To")
|
||||
is_enabled = fields.Boolean("Enabled", compute="_compute_is_enabled")
|
||||
_sql_constraints = [
|
||||
(
|
||||
"user_role_uniq",
|
||||
"unique (user_id,role_id)",
|
||||
"Roles can be assigned to a user only once at a time",
|
||||
)
|
||||
]
|
||||
|
||||
@api.depends("date_from", "date_to")
|
||||
def _compute_is_enabled(self):
|
||||
|
||||
Reference in New Issue
Block a user