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.

53 lines
2.0 KiB

  1. ###################################################################################
  2. #
  3. # Copyright (C) 2018 MuK IT GmbH
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU Affero General Public License as
  7. # published by the Free Software Foundation, either version 3 of the
  8. # License, or (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU Affero General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. #
  18. ###################################################################################
  19. from odoo import models, fields
  20. class ResUsers(models.Model):
  21. _inherit = 'res.users'
  22. sidebar_type = fields.Selection(
  23. selection=[
  24. ('invisible', 'Invisible'),
  25. ('small', 'Small'),
  26. ('large', 'Large')
  27. ],
  28. string="Sidebar Type",
  29. default='small',
  30. required=True)
  31. chatter_position = fields.Selection(
  32. selection=[
  33. ('normal', 'Normal'),
  34. ('sided', 'Sided'),
  35. ],
  36. string="Chatter Position",
  37. default='sided',
  38. required=True)
  39. def __init__(self, pool, cr):
  40. init_res = super(ResUsers, self).__init__(pool, cr)
  41. type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
  42. type(self).SELF_WRITEABLE_FIELDS.extend(['sidebar_type'])
  43. type(self).SELF_WRITEABLE_FIELDS.extend(['chatter_position'])
  44. type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
  45. type(self).SELF_READABLE_FIELDS.extend(['sidebar_type'])
  46. type(self).SELF_READABLE_FIELDS.extend(['chatter_position'])
  47. return init_res