diff options
| author | Martin Trigaux <mat@openerp.com> | 2013-04-03 17:10:56 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@openerp.com> | 2013-04-03 17:10:56 +0200 |
| commit | 46110fbf2995f3a8104f3f08007db4cf43000a85 (patch) | |
| tree | 7ef224499a8f332014eb4a40b3bc1ca5adc6a2d4 /addons/mail/res_users.py | |
| parent | 788501fd7804a45319d7776a381d2e6f42215df7 (diff) | |
[ADD] option to globally stop showing group suggestions
bzr revid: mat@openerp.com-20130403151056-4vjno2k9n77drm6y
Diffstat (limited to 'addons/mail/res_users.py')
| -rw-r--r-- | addons/mail/res_users.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/addons/mail/res_users.py b/addons/mail/res_users.py index f7c91939b98..4fe7e34aec7 100644 --- a/addons/mail/res_users.py +++ b/addons/mail/res_users.py @@ -28,6 +28,7 @@ class res_users(osv.Model): - add a preference about sending emails about notifications - make a new user follow itself - add a welcome message + - add suggestion preference """ _name = 'res.users' _inherit = ['res.users'] @@ -37,10 +38,12 @@ class res_users(osv.Model): 'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True, help="Email address internally associated with this user. Incoming "\ "emails will appear in the user's notifications."), + 'display_groups_suggestions': fields.boolean("Display Group Suggestions"), } _defaults = { 'alias_domain': False, # always hide alias during creation + 'display_groups_suggestions': True, } def __init__(self, pool, cr): @@ -51,10 +54,10 @@ class res_users(osv.Model): 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_send') + self.SELF_WRITEABLE_FIELDS.extend(['notification_email_send', 'display_groups_suggestions']) # duplicate list to avoid modifying the original reference self.SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS) - self.SELF_READABLE_FIELDS.extend(['notification_email_send', 'alias_domain', 'alias_name']) + self.SELF_READABLE_FIELDS.extend(['notification_email_send', 'alias_domain', 'alias_name', 'display_groups_suggestions']) return init_res def _auto_init(self, cr, context=None): @@ -156,6 +159,11 @@ class res_users(osv.Model): def message_create_partners_from_emails(self, cr, uid, emails, context=None): return self.pool.get('res.partner').message_create_partners_from_emails(cr, uid, emails, context=context) + def stop_showing_group_suggestions(self, cr, uid, user_id, context=None): + """Update display_groups_suggestions value to False""" + if context is None: context = {} + self.write(cr, uid, user_id, {"display_groups_suggestions": False}, context) + class res_users_mail_group(osv.Model): """ Update of res.users class |
