[IMP] Code

pull/2684/head
QS5ELkMu 2018-06-25 17:25:13 +02:00 committed by Taras Shabaranskyi
parent c4c5d7a562
commit aa0d93206a
1 changed files with 9 additions and 9 deletions

View File

@ -7,21 +7,21 @@ from odoo import models, fields
class ResUsers(models.Model): class ResUsers(models.Model):
_inherit = 'res.users' _inherit = 'res.users'
chatter_position = fields.Selection([
('normal', 'Normal'),
('sided', 'Sided'),
], string="Chatter Position", default='normal')
def __init__(self, pool, cr): def __init__(self, pool, cr):
""" Override of __init__ to add access rights. """ Override of __init__ to add access rights.
Access rights are disabled by default, but allowed Access rights are disabled by default, but allowed on some specific
on some specific fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS. 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 # duplicate list to avoid modifying the original reference
type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS) type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
type(self).SELF_WRITEABLE_FIELDS.extend(['chatter_position']) type(self).SELF_WRITEABLE_FIELDS.extend(['chatter_position'])
# duplicate list to avoid modifying the original reference # duplicate list to avoid modifying the original reference
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS) type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
type(self).SELF_READABLE_FIELDS.extend(['chatter_position']) type(self).SELF_READABLE_FIELDS.extend(['chatter_position'])
return init_res
chatter_position = fields.Selection([
('normal', 'Normal'),
('sided', 'Sided'),
], string="Chatter Position", default='normal')