From b19fa2398df6e7a2eebe5fb80363ceb96690906f 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base_user_role/models/role.py b/base_user_role/models/role.py index 41552a06c..bd60e3fd3 100644 --- a/base_user_role/models/role.py +++ b/base_user_role/models/role.py @@ -66,9 +66,10 @@ class ResUsersRoleLine(models.Model): _description = 'Users associated to a role' role_id = fields.Many2one( - 'res.users.role', string=u"Role", ondelete='cascade') + 'res.users.role', required=True, string=u"Role", ondelete='cascade') user_id = fields.Many2one( - 'res.users', string=u"User", domain=[('id', '!=', SUPERUSER_ID)]) + 'res.users', required=True, string=u"User", + domain=[('id', '!=', SUPERUSER_ID)], ondelete='cascade') date_from = fields.Date(u"From") date_to = fields.Date(u"To") is_enabled = fields.Boolean(u"Enabled", compute='_compute_is_enabled')