emails:- fix problem of reference value.
bzr revid: ysa@tinyerp.com-20110224112508-najqlczluuxdo87e
This commit is contained in:
@@ -85,9 +85,6 @@ class email_message_template(osv.osv_memory):
|
||||
'description': fields.text('Description', translate=True),
|
||||
'smtp_server_id':fields.many2one('email.smtp_server', 'SMTP Server'),
|
||||
}
|
||||
_defaults = {
|
||||
'references': lambda * a: None,
|
||||
}
|
||||
|
||||
_sql_constraints = []
|
||||
email_message_template()
|
||||
@@ -273,7 +270,7 @@ class email_message(osv.osv):
|
||||
'reply_to': reply_to,
|
||||
'res_id': openobject_id,
|
||||
'message_id': message_id,
|
||||
'references': references,
|
||||
'references': references or '',
|
||||
'sub_type': subtype or '',
|
||||
'headers': x_headers or False,
|
||||
'priority': priority,
|
||||
|
||||
@@ -85,7 +85,7 @@ class email_compose_message(osv.osv_memory):
|
||||
result['user_id'] = message_data and message_data.user_id and message_data.user_id.id or False
|
||||
|
||||
if 'references' in fields:
|
||||
result['references'] = tools.ustr(message_data and message_data.references)
|
||||
result['references'] = message_data and message_data.references and tools.ustr(message_data.references)
|
||||
|
||||
if 'sub_type' in fields:
|
||||
result['sub_type'] = message_data and message_data.sub_type
|
||||
@@ -159,7 +159,7 @@ class email_compose_message(osv.osv_memory):
|
||||
references = False
|
||||
message_id = False
|
||||
if context.get('mail',False) == 'reply' and mail.message_id:
|
||||
references = mail.references and str(mail.references) != 'False' and mail.references + "," + mail.message_id or mail.message_id
|
||||
references = mail.references and mail.references + "," + mail.message_id or mail.message_id
|
||||
else:
|
||||
message_id = mail.message_id
|
||||
email_id = email_message_pool.email_send(cr, uid, mail.email_from, mail.email_to, mail.name, mail.description,
|
||||
|
||||
Reference in New Issue
Block a user