From 9b5fa560e352b1e1623a2c2827b8dd1a8f001a9a Mon Sep 17 00:00:00 2001 From: Pierrick Brun Date: Tue, 29 Jan 2019 14:32:51 +0100 Subject: [PATCH] Make user_id and role_id required in base_user_role_line --- base_user_role/models/role.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base_user_role/models/role.py b/base_user_role/models/role.py index 65ba83e7d..8fd56eca4 100644 --- a/base_user_role/models/role.py +++ b/base_user_role/models/role.py @@ -74,11 +74,11 @@ class ResUsersRoleLine(models.Model): _description = 'Users associated to a role' role_id = fields.Many2one( - comodel_name='res.users.role', string="Role", + comodel_name='res.users.role', required=True, string="Role", ondelete='cascade') user_id = fields.Many2one( - comodel_name='res.users', string="User", - domain=[('id', '!=', SUPERUSER_ID)]) + comodel_name='res.users', required=True, string="User", + domain=[('id', '!=', SUPERUSER_ID)], ondelete='cascade') date_from = fields.Date("From") date_to = fields.Date("To") is_enabled = fields.Boolean("Enabled", compute='_compute_is_enabled')