diff options
| author | Paramjit Singh Sahota <psa@tinyerp.com> | 2013-03-21 18:18:59 +0530 |
|---|---|---|
| committer | Paramjit Singh Sahota <psa@tinyerp.com> | 2013-03-21 18:18:59 +0530 |
| commit | e627fce6b8a3b9db56967a7b8d93b24a9bdc45f5 (patch) | |
| tree | 81c4ec574bed97a11b0c64c52fd85b4899bbfa3d | |
| parent | e9065f77273a544c99b546bf58201ee9c08b4b73 (diff) | |
[IMP] Little improvement with context(context is None:).
bzr revid: psa@tinyerp.com-20130321124859-281pcjosai1xtvaj
| -rw-r--r-- | addons/mail/mail_thread.py | 4 |
1 files changed, 3 insertions, 1 deletions
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') |
