|
@ -88,6 +88,13 @@ class ResUsersRoleLine(models.Model): |
|
|
date_from = fields.Date("From") |
|
|
date_from = fields.Date("From") |
|
|
date_to = fields.Date("To") |
|
|
date_to = fields.Date("To") |
|
|
is_enabled = fields.Boolean("Enabled", compute="_compute_is_enabled") |
|
|
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") |
|
|
@api.depends("date_from", "date_to") |
|
|
def _compute_is_enabled(self): |
|
|
def _compute_is_enabled(self): |
|
|