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.

36 lines
1.5 KiB

  1. # Copyright 2019 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. view_transition_mode = fields.Selection([
  7. ('scale-back-top', 'Scale (Back-Top)'),
  8. ('scale-top-back', 'Scale (Top-Back)'),
  9. ('skew', 'Skew'),
  10. ('translate-left-right', 'Translate (Left-Right)'),
  11. ('translate-right-left', 'Translate (Right-Left)'),
  12. ('translate-top-down', 'Translate (Top-Down)'),
  13. ('translate-down-top', 'Translate (Down-Top)'),
  14. ('fade-in', 'Fade-In'),
  15. ('circle-in', 'Circle-In'),
  16. ('rotate-x-3d', 'Rotate X Top (3D)'),
  17. ('rotate-y-3d', 'Rotate Y (3D)'),
  18. ('rotate-x-2d', 'Rotate X'),
  19. ], string="View Transition Mode")
  20. def __init__(self, pool, cr):
  21. """ Override of __init__ to add access rights.
  22. Access rights are disabled by default, but allowed on some specific
  23. fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
  24. """
  25. super().__init__(pool, cr)
  26. # duplicate list to avoid modifying the original reference
  27. type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
  28. type(self).SELF_WRITEABLE_FIELDS.extend(['view_transition_mode'])
  29. # duplicate list to avoid modifying the original reference
  30. type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
  31. type(self).SELF_READABLE_FIELDS.extend(['view_transition_mode'])