From 17c2939ddc764f88797f1a2a3e4b72bc44468daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 14 Nov 2012 12:11:29 +0100 Subject: [PATCH] [IMP] mail_thread: message_process: plaintext incoming messages are preserved in pre tags. bzr revid: tde@openerp.com-20121114111129-8nkneu1h6ij2lk99 --- addons/mail/mail_thread.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index d18d056e439..81120151de1 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -520,7 +520,7 @@ class mail_thread(osv.AbstractModel): body = tools.ustr(body, encoding, errors='replace') if message.get_content_type() == 'text/plain': # text/plain ->
-                body = tools.append_content_to_html(u'', body)
+                body = tools.append_content_to_html(u'', body, preserve=True)
         else:
             alternative = (message.get_content_type() == 'multipart/alternative')
             for part in message.walk():
@@ -535,7 +535,7 @@ class mail_thread(osv.AbstractModel):
                 # 2) text/plain -> 
                 if part.get_content_type() == 'text/plain' and (not alternative or not body):
                     body = tools.append_content_to_html(body, tools.ustr(part.get_payload(decode=True),
-                                                                         encoding, errors='replace'))
+                                                                         encoding, errors='replace'), preserve=True)
                 # 3) text/html -> raw
                 elif part.get_content_type() == 'text/html':
                     html = tools.ustr(part.get_payload(decode=True), encoding, errors='replace')