mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[IMP] Code
This commit is contained in:
committed by
Sergey Shebanin
parent
0c2cb55d56
commit
d2a1b8e79f
@@ -7,21 +7,21 @@ from odoo import models, fields
|
||||
class ResUsers(models.Model):
|
||||
_inherit = 'res.users'
|
||||
|
||||
chatter_position = fields.Selection([
|
||||
('normal', 'Normal'),
|
||||
('sided', 'Sided'),
|
||||
], string="Chatter Position", default='normal')
|
||||
|
||||
|
||||
def __init__(self, pool, cr):
|
||||
""" Override of __init__ to add access rights.
|
||||
Access rights are disabled by default, but allowed
|
||||
on some specific fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
|
||||
Access rights are disabled by default, but allowed on some specific
|
||||
fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
|
||||
"""
|
||||
init_res = super(ResUsers, self).__init__(pool, cr)
|
||||
super(ResUsers, self).__init__(pool, cr)
|
||||
# duplicate list to avoid modifying the original reference
|
||||
type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
|
||||
type(self).SELF_WRITEABLE_FIELDS.extend(['chatter_position'])
|
||||
# duplicate list to avoid modifying the original reference
|
||||
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
|
||||
type(self).SELF_READABLE_FIELDS.extend(['chatter_position'])
|
||||
return init_res
|
||||
|
||||
chatter_position = fields.Selection([
|
||||
('normal', 'Normal'),
|
||||
('sided', 'Sided'),
|
||||
], string="Chatter Position", default='normal')
|
||||
|
||||
Reference in New Issue
Block a user