[IMP] Little improvement with context(context is None:).
authorParamjit Singh Sahota <psa@tinyerp.com>
Thu, 21 Mar 2013 12:48:59 +0000 (18:18 +0530)
committerParamjit Singh Sahota <psa@tinyerp.com>
Thu, 21 Mar 2013 12:48:59 +0000 (18:18 +0530)
bzr revid: psa@tinyerp.com-20130321124859-281pcjosai1xtvaj

addons/mail/mail_thread.py

index 2268e66..c8086a8 100644 (file)
@@ -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')