[CLEAN] mail: res_partner: removed dead code. Also fixe da typo in mail tests.

bzr revid: tde@openerp.com-20120823131144-xbryqdesfw5ix8y9
This commit is contained in:
Thibault Delavallée
2012-08-23 15:11:44 +02:00
parent 690bc2ece9
commit f3b43da73b
2 changed files with 4 additions and 12 deletions
+3 -11
View File
@@ -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:
+1 -1
View File
@@ -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)