diff --git a/addons/mail/res_partner.py b/addons/mail/res_partner.py index 6f1808c1612..c8b1e9c9240 100644 --- a/addons/mail/res_partner.py +++ b/addons/mail/res_partner.py @@ -22,20 +22,10 @@ from osv import osv, fields class res_partner_mail(osv.Model): - """ Inherits partner and adds CRM information in the partner form """ + """ Update partner to add a field about notification preferences """ _name = "res.partner" _inherit = ['res.partner', 'mail.thread'] - def message_search_get_domain(self, cr, uid, ids, context=None): - """ Override of message_search_get_domain for partner discussion page. - The purpose is to add messages directly sent to the partner. It also - adds messages pushed to the related user, if any, using @login. - """ - if self._name != 'res.partner': - return super(res_partner_mail, self).message_search_get_domain(cr, uid, ids, context=context) - # add message linked to the partner - return [('partner_ids', 'in', ids)] - _columns = { 'notification_email_pref': fields.selection([ ('all', 'All feeds'), @@ -45,8 +35,10 @@ class res_partner_mail(osv.Model): help="Choose in which case you want to receive an email when you "\ "receive new feeds."), } + _defaults = { 'notification_email_pref': lambda *args: 'comment' } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mail/tests/test_mail.py b/addons/mail/tests/test_mail.py index a1249994ebd..a424a408067 100644 --- a/addons/mail/tests/test_mail.py +++ b/addons/mail/tests/test_mail.py @@ -117,7 +117,7 @@ class test_mail(common.TransactionCase): def test_01_many2many_reference_field(self): """ Tests designed for the many2many_reference field (follower_ids). - We will test to perform write using the many2many commands 0, 3, 4, + We will test to perform writes using the many2many commands 0, 3, 4, 5 and 6. """ cr, uid = self.cr, self.uid user_admin = self.res_users.browse(cr, uid, uid)