summaryrefslogtreecommitdiff
path: root/addons/mail
diff options
context:
space:
mode:
authorRifakat Haradwala (Open ERP) <rha@tinyerp.com>2011-04-21 14:41:25 +0530
committerRifakat Haradwala (Open ERP) <rha@tinyerp.com>2011-04-21 14:41:25 +0530
commitb794d93e2a42eac8f3466c290b5ce7bdfc8a8547 (patch)
tree07b82d13b7c493329cae8150abb8467288a5a383 /addons/mail
parentb511ca0034c5de98e7ffb6959ab9abdf0b3c80da (diff)
[FIX] thunderbird: changes in partner.py for history()
bzr revid: rha@tinyerp.com-20110421091125-nevt80ac5y1vn5jy
Diffstat (limited to 'addons/mail')
-rw-r--r--addons/mail/email_message.py2
-rw-r--r--addons/mail/email_thread.py9
2 files changed, 6 insertions, 5 deletions
diff --git a/addons/mail/email_message.py b/addons/mail/email_message.py
index b9e1a7a368e..6fb1bc87035 100644
--- a/addons/mail/email_message.py
+++ b/addons/mail/email_message.py
@@ -295,6 +295,7 @@ class email_message(osv.osv):
"""Return Dictionary Object after parse EML Message String
@param message: email.message.Message object or string or unicode object
"""
+ msg_txt = message
if isinstance(message, str):
msg_txt = email.message_from_string(message)
@@ -304,7 +305,6 @@ class email_message(osv.osv):
message = message.encode('utf-8')
msg_txt = email.message_from_string(message)
- msg_txt = message
message_id = msg_txt.get('message-id', False)
msg = {}
diff --git a/addons/mail/email_thread.py b/addons/mail/email_thread.py
index 796fc35bb92..df26adab354 100644
--- a/addons/mail/email_thread.py
+++ b/addons/mail/email_thread.py
@@ -158,10 +158,7 @@ class email_thread(osv.osv):
if attach is None:
attach = {}
- model = context.get('thread_model', False)
- if not model:
- model = self._name
- model_pool = self.pool.get(model)
+
if email_date:
edate = parsedate(email_date)
@@ -171,6 +168,10 @@ class email_thread(osv.osv):
# The script sends the ids of the threads and not the object list
if all(isinstance(thread_id, (int, long)) for thread_id in threads):
+ model = context.get('thread_model', False)
+ if not model:
+ model = self._name
+ model_pool = self.pool.get(model)
threads = model_pool.browse(cr, uid, threads, context=context)
att_obj = self.pool.get('ir.attachment')