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.

27 lines
1.1 KiB

  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. def __init__(self, pool, cr):
  7. """ Override of __init__ to add access rights on notification_email_send
  8. and alias fields. Access rights are disabled by default, but allowed
  9. on some specific fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
  10. """
  11. init_res = super(ResUsers, self).__init__(pool, cr)
  12. # duplicate list to avoid modifying the original reference
  13. type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
  14. type(self).SELF_WRITEABLE_FIELDS.extend(['chatter_position'])
  15. # duplicate list to avoid modifying the original reference
  16. type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
  17. type(self).SELF_READABLE_FIELDS.extend(['chatter_position'])
  18. return init_res
  19. chatter_position = fields.Selection([
  20. ('normal', 'Normal'),
  21. ('sided', 'Sided'),
  22. ], string="Chatter Position", default='normal')