forked from gfcapalbo/social
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathres_users.py
28 lines (22 loc) · 1.11 KB
/
res_users.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -*- coding: utf-8 -*-
# Copyright 2017 Simone Orsi <[email protected]>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import models
class Users(models.Model):
_name = 'res.users'
_inherit = ['res.users']
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.
[copied from mail.models.users]
"""
super(Users, 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(['notify_frequency'])
type(self).SELF_WRITEABLE_FIELDS.extend(['notify_conf_ids'])
# duplicate list to avoid modifying the original reference
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
type(self).SELF_READABLE_FIELDS.extend(['notify_frequency'])
type(self).SELF_READABLE_FIELDS.extend(['notify_conf_ids'])