[FIX]: useability
bzr revid: rha@tinyerp.com-20110511122151-0dc5z3blbp2co9c1
This commit is contained in:
parent
89ee28b7d1
commit
3f18d22fc9
|
@ -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', ''):
|
||||
|
|
|
@ -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 '')
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue