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.

26 lines
1.0 KiB

6 years ago
6 years ago
6 years ago
  1. # Copyright 2018 Alexandre Díaz
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import models, fields
  4. class ResUsers(models.Model):
  5. _inherit = 'res.users'
  6. chatter_position = fields.Selection([
  7. ('normal', 'Normal'),
  8. ('sided', 'Sided'),
  9. ], string="Chatter Position", default='normal')
  10. def __init__(self, pool, cr):
  11. """ Override of __init__ to add access rights.
  12. Access rights are disabled by default, but allowed on some specific
  13. fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
  14. """
  15. super(ResUsers, self).__init__(pool, cr)
  16. # duplicate list to avoid modifying the original reference
  17. type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
  18. type(self).SELF_WRITEABLE_FIELDS.extend(['chatter_position'])
  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(['chatter_position'])