[FIX]: useability
authorRifakat Haradwala (Open ERP) <rha@tinyerp.com>
Wed, 11 May 2011 12:21:51 +0000 (17:51 +0530)
committerRifakat Haradwala (Open ERP) <rha@tinyerp.com>
Wed, 11 May 2011 12:21:51 +0000 (17:51 +0530)
bzr revid: rha@tinyerp.com-20110511122151-0dc5z3blbp2co9c1

addons/mail/email_message.py
addons/mail/email_thread.py
addons/mail/wizard/email_compose_message.py

index 8ef0dde..c8fbc64 100644 (file)
@@ -162,7 +162,7 @@ class email_message(osv.osv):
         """
         action_data = False
         action_pool = self.pool.get('ir.actions.act_window')
-        message_pool = self.browse(cr ,uid, ids, context=context)[0]
+        message_pool = self.browse(cr, uid, ids, context=context)[0]
         att_ids = [x.id for x in message_pool.attachment_ids]
         action_ids = action_pool.search(cr, uid, [('res_model', '=', 'ir.attachment')])
         if action_ids:
@@ -309,8 +309,8 @@ class email_message(osv.osv):
             text = decode_header(text.replace('\r', ''))
             return ''.join([tools.ustr(x[0], x[1]) for x in text])
 
-    def to_email(self,text):
-        return re.findall(r'([^ ,<@]+@[^> ,]+)',text)
+    def to_email(self, text):
+        return re.findall(r'([^ ,<@]+@[^> ,]+)', text)
 
     def parse_message(self, message):
         """Return Dictionary Object after parse EML Message String
@@ -390,7 +390,6 @@ class email_message(osv.osv):
             msg['body'] = tools.ustr(body, encoding)
 
         attachments = {}
-        has_plain_text = False
         if msg_txt.is_multipart() or 'multipart/alternative' in msg.get('content-type', ''):
             body = ""
             if 'multipart/alternative' in msg.get('content-type', ''):
index 44d957c..236a0b5 100644 (file)
@@ -26,7 +26,6 @@ import binascii
 import email
 
 from email.utils import parsedate
-import base64
 
 from tools.translate import _
 import logging
@@ -77,7 +76,7 @@ class email_thread(osv.osv):
         model_pool = self.pool.get(model)
         fields = model_pool.fields_get(cr, uid, context=context)
         data = model_pool.default_get(cr, uid, fields, context=context)
-        if 'name' in fields and not data.get('name',False):
+        if 'name' in fields and not data.get('name', False):
             data['name'] = msg.get('from','')
         res_id = model_pool.create(cr, uid, data, context=context)
 
@@ -137,7 +136,7 @@ class email_thread(osv.osv):
         if isinstance(ids, (str, int, long)):
             ids = [long(ids)]
         for thread in self.browse(cr, uid, ids, context=context):
-            l=[]
+            l = []
             for message in thread.message_ids:
                 l.append((message.user_id and message.user_id.email) or '')
                 l.append(message.email_from or '')
index 98fdd64..b542d2e 100644 (file)
@@ -131,7 +131,7 @@ class email_compose_message(osv.osv_memory):
             message_id = False
 
             # Reply Email
-            if context.get('mail',False) == 'reply' and  mail.message_id:
+            if context.get('mail') == 'reply' and  mail.message_id:
                 references = mail.references and mail.references + "," + mail.message_id or mail.message_id
             else:
                 message_id = mail.message_id