[IMP] mail_mail: re-instaured body_alternative, using html2plaintext of tools. Removed some dead imports.

bzr revid: tde@openerp.com-20120824160936-n3fehtgf4f2k0dkn
This commit is contained in:
Thibault Delavallée 2012-08-24 18:09:36 +02:00
parent ab6b3cc266
commit 6e3ea98e48
1 changed files with 3 additions and 7 deletions

View File

@ -19,13 +19,9 @@
#
##############################################################################
import ast
# import ast
import base64
import datetime
import email
import logging
import re
import time
import tools
from osv import osv
@ -158,10 +154,10 @@ class mail_mail(osv.Model):
body = message.body_html if message.content_subtype == 'html' else message.body
body_alternative = None
content_subtype_alternative = None
if message.content_subtype == 'html' and message.body:
if message.content_subtype == 'html':
# we have a plain text alternative prepared, pass it to
# build_message instead of letting it build one
body_alternative = message.body
body_alternative = tools.html2plaintext(message.body)
content_subtype_alternative = 'plain'
# handle destination_partners