From 45d6fe098f76720c6347aeb33193f6859bdf87da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 6 Apr 2012 09:40:18 +0200 Subject: [PATCH] [FIX] res.users in mail.thread: addded right to modify notification_email_pref for users. bzr revid: tde@openerp.com-20120406074018-4jd1m038jwwi04m4 --- addons/mail/res_users.py | 11 +++++++++++ addons/mail/res_users_view.xml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/mail/res_users.py b/addons/mail/res_users.py index 6c85e625e46..6efb218a658 100644 --- a/addons/mail/res_users.py +++ b/addons/mail/res_users.py @@ -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] diff --git a/addons/mail/res_users_view.xml b/addons/mail/res_users_view.xml index 4ace3f9f2d2..93a60e1cdb1 100644 --- a/addons/mail/res_users_view.xml +++ b/addons/mail/res_users_view.xml @@ -10,7 +10,7 @@ - +