From d081af362cb00b376753121e24ae6d49944c0fa7 Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Tue, 21 Feb 2012 18:42:38 +0530 Subject: [PATCH 1/2] [FIX] mail: remove the unused charector from the message body using filter. bzr revid: nco@tinyerp.com-20120221131238-czel3dz0b51ac2dz --- addons/mail/mail_message.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 1693397f6fa..1d84468ca85 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -441,7 +441,8 @@ class mail_message(osv.osv): if part.get_content_subtype() == 'html': msg['body_html'] = content msg['subtype'] = 'html' # html version prevails - body = tools.ustr(tools.html2plaintext(content)) + #this filter will remove " " unused charector which generaed by space + body = filter(lambda c: c not in " ", tools.ustr(tools.html2plaintext(content))) elif part.get_content_subtype() == 'plain': body = content elif part.get_content_maintype() in ('application', 'image'): From e6131b194f8a51508b8044b772961593d72ed3bc Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Thu, 23 Feb 2012 11:10:22 +0530 Subject: [PATCH 2/2] [FIX] mail: remove the unused charector generated by the html2plaintext function from the message. bzr revid: nco@tinyerp.com-20120223054022-9l9hxv3ssiajdf9p --- addons/mail/mail_message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 1d84468ca85..dc372aec84a 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -441,8 +441,8 @@ class mail_message(osv.osv): if part.get_content_subtype() == 'html': msg['body_html'] = content msg['subtype'] = 'html' # html version prevails - #this filter will remove " " unused charector which generaed by space - body = filter(lambda c: c not in " ", tools.ustr(tools.html2plaintext(content))) + body = tools.ustr(tools.html2plaintext(content)) + body = body.replace(' ', '') elif part.get_content_subtype() == 'plain': body = content elif part.get_content_maintype() in ('application', 'image'):