From e627fce6b8a3b9db56967a7b8d93b24a9bdc45f5 Mon Sep 17 00:00:00 2001 From: Paramjit Singh Sahota Date: Thu, 21 Mar 2013 18:18:59 +0530 Subject: [PATCH] [IMP] Little improvement with context(context is None:). bzr revid: psa@tinyerp.com-20130321124859-281pcjosai1xtvaj --- addons/mail/mail_thread.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 2268e66ce36..c8086a8db76 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -116,6 +116,8 @@ class mail_thread(osv.AbstractModel): """ Computes: - message_subtype_data: data about document subtypes: which are available, which are followed if any """ + if context is None: + context = {} res = dict((id, dict(message_subtype_data='')) for id in ids) user_pid = self.pool.get('res.users').read(cr, uid, uid, ['partner_id'], context=context)['partner_id'][0] @@ -126,7 +128,7 @@ class mail_thread(osv.AbstractModel): for id in ids: res[id]['message_subtype_data'] = subtype_dict.copy() - if context and 'partner_id' in context: + if 'partner_id' in context: user_pid = context.get('partner_id') # find the document followers, update the data fol_obj = self.pool.get('mail.followers')