forked from Techsystech/web
[FIX] Read/Write permissions
parent
8f5d050ff5
commit
3de495cb60
|
@ -7,6 +7,20 @@ from odoo import models, fields
|
||||||
class ResUsers(models.Model):
|
class ResUsers(models.Model):
|
||||||
_inherit = 'res.users'
|
_inherit = 'res.users'
|
||||||
|
|
||||||
|
def __init__(self, pool, cr):
|
||||||
|
""" Override of __init__ to add access rights on notification_email_send
|
||||||
|
and alias 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)
|
||||||
|
# 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([
|
chatter_position = fields.Selection([
|
||||||
('normal', 'Normal'),
|
('normal', 'Normal'),
|
||||||
('sided', 'Sided'),
|
('sided', 'Sided'),
|
||||||
|
|
Loading…
Reference in New Issue