[FIX] res.users in mail.thread: addded right to modify notification_email_pref for users.

bzr revid: tde@openerp.com-20120406074018-4jd1m038jwwi04m4
This commit is contained in:
Thibault Delavallée 2012-04-06 09:40:18 +02:00
parent 73e9efa863
commit 45d6fe098f
2 changed files with 12 additions and 1 deletions

View File

@ -44,6 +44,17 @@ class res_users(osv.osv):
'notification_email_pref': 'all',
}
def __init__(self, pool, cr):
""" Override of __init__ to add access rights on notification_email_pref
field. Access rights are disabled by default, but allowed on
fields defined in self.SELF_WRITEABLE_FIELDS.
"""
init_res = super(res_users, self).__init__(pool, cr)
# duplicate list to avoid modifying the original reference
self.SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
self.SELF_WRITEABLE_FIELDS.append('notification_email_pref')
return init_res
def create(self, cr, uid, data, context=None):
user_id = super(res_users, self).create(cr, uid, data, context=context)
user = self.browse(cr, uid, [user_id], context=context)[0]

View File

@ -10,7 +10,7 @@
<field name="arch" type="xml">
<data>
<xpath expr="/form/group/group[@name='preferences']/field[@name='menu_tips']" position="after">
<field name="notification_email_pref"/>
<field name="notification_email_pref" readonly="0"/>
</xpath>
</data>
</field>