Browse Source

Make user_id and role_id required in base_user_role_line

pull/1489/head
Pierrick Brun 6 years ago
parent
commit
b19fa2398d
  1. 5
      base_user_role/models/role.py

5
base_user_role/models/role.py

@ -66,9 +66,10 @@ class ResUsersRoleLine(models.Model):
_description = 'Users associated to a role' _description = 'Users associated to a role'
role_id = fields.Many2one( 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( 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_from = fields.Date(u"From")
date_to = fields.Date(u"To") date_to = fields.Date(u"To")
is_enabled = fields.Boolean(u"Enabled", compute='_compute_is_enabled') is_enabled = fields.Boolean(u"Enabled", compute='_compute_is_enabled')

Loading…
Cancel
Save