Browse Source

[10.0][UPD] base_user_role: Disabled Administrator user selection in notebook users line (#1170)

pull/1288/head
_tux 7 years ago
committed by Jairo Llopis
parent
commit
391313dc63
  1. 1
      base_user_role/README.rst
  2. 2
      base_user_role/__manifest__.py
  3. 3
      base_user_role/models/role.py

1
base_user_role/README.rst

@ -68,6 +68,7 @@ Contributors
------------ ------------
* Sébastien Alix <sebastien.alix@osiell.com> * Sébastien Alix <sebastien.alix@osiell.com>
* Antonio Russo <antonio.r@rwsdigital.com>
Maintainer Maintainer
---------- ----------

2
base_user_role/__manifest__.py

@ -4,7 +4,7 @@
{ {
'name': 'User roles', 'name': 'User roles',
'version': '10.0.1.0.1',
'version': '10.0.1.0.2',
'category': 'Tools', 'category': 'Tools',
'author': 'ABF OSIELL, Odoo Community Association (OCA)', 'author': 'ABF OSIELL, Odoo Community Association (OCA)',
'license': 'AGPL-3', 'license': 'AGPL-3',

3
base_user_role/models/role.py

@ -6,6 +6,7 @@ import datetime
import logging import logging
from odoo import api, fields, models from odoo import api, fields, models
from odoo import SUPERUSER_ID
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
@ -66,7 +67,7 @@ class ResUsersRoleLine(models.Model):
role_id = fields.Many2one( role_id = fields.Many2one(
'res.users.role', string=u"Role", ondelete='cascade') 'res.users.role', string=u"Role", ondelete='cascade')
user_id = fields.Many2one( user_id = fields.Many2one(
'res.users', string=u"User")
'res.users', string=u"User", domain=[('id', '!=', SUPERUSER_ID)])
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