diff --git a/addons/emails/email_message.py b/addons/emails/email_message.py index f51b19df207..7aef05d9af3 100644 --- a/addons/emails/email_message.py +++ b/addons/emails/email_message.py @@ -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, diff --git a/addons/emails/wizard/email_compose_message.py b/addons/emails/wizard/email_compose_message.py index e951e0f97f1..1f4dfb464be 100644 --- a/addons/emails/wizard/email_compose_message.py +++ b/addons/emails/wizard/email_compose_message.py @@ -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,