From 8dfc2ddc5e50f3024a5319a6b887934d2e333171 Mon Sep 17 00:00:00 2001 From: QS5ELkMu Date: Mon, 25 Jun 2018 15:26:20 +0200 Subject: [PATCH] [FIX] Read/Write permissions --- web_responsive/models/inherited_res_users.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/web_responsive/models/inherited_res_users.py b/web_responsive/models/inherited_res_users.py index f567f3aa..1de66bda 100644 --- a/web_responsive/models/inherited_res_users.py +++ b/web_responsive/models/inherited_res_users.py @@ -7,6 +7,20 @@ from odoo import models, fields class ResUsers(models.Model): _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([ ('normal', 'Normal'), ('sided', 'Sided'),