You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.1 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2017 Simone Orsi <simone.orsi@camptocamp.com>
  3. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
  4. from odoo import models
  5. class Users(models.Model):
  6. _name = 'res.users'
  7. _inherit = ['res.users']
  8. def __init__(self, pool, cr):
  9. """ Override of __init__ to add access rights.
  10. Access rights are disabled by default, but allowed
  11. on some specific fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
  12. [copied from mail.models.users]
  13. """
  14. super(Users, self).__init__(pool, cr)
  15. # duplicate list to avoid modifying the original reference
  16. type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
  17. type(self).SELF_WRITEABLE_FIELDS.extend(['notify_frequency'])
  18. type(self).SELF_WRITEABLE_FIELDS.extend(['notify_conf_ids'])
  19. # duplicate list to avoid modifying the original reference
  20. type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
  21. type(self).SELF_READABLE_FIELDS.extend(['notify_frequency'])
  22. type(self).SELF_READABLE_FIELDS.extend(['notify_conf_ids'])