From c0e139bd4bdbd5e5feb9b3595a67655302be840c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 7 Nov 2012 09:59:26 +0100 Subject: [PATCH] [IMP] mail: displayed messages now goe through html_email_clean to clean their content; added a css because we now have lots of

in chatter messages, and default margin is quite big (to be improved maybe); updated demo data. bzr revid: tde@openerp.com-20121107085926-9g609zgmkg4kieqc --- addons/mail/data/mail_demo.xml | 15 ++++++++------- addons/mail/data/mail_group_data.xml | 11 +++++------ addons/mail/mail_message.py | 3 ++- addons/mail/static/src/css/mail.css | 4 ++++ 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/addons/mail/data/mail_demo.xml b/addons/mail/data/mail_demo.xml index bda93fc485d..889a3381135 100644 --- a/addons/mail/data/mail_demo.xml +++ b/addons/mail/data/mail_demo.xml @@ -1,12 +1,13 @@ - + + mail.group - Your monthly meal vouchers arrived. You can get them at Christine's office. -This month you also get 250 EUR of eco-vouchers if you have been in the company for more than a year. + Your monthly meal vouchers arrived. You can get them at Christine's office. +This month you also get 250 EUR of eco-vouchers if you have been in the company for more than a year.

]]> comment @@ -14,7 +15,7 @@ This month you also get 250 EUR of eco-vouchers if you have been in the company mail.group - + Great.

]]>
comment @@ -23,7 +24,7 @@ This month you also get 250 EUR of eco-vouchers if you have been in the company mail.group - Thanks, but where is Christine's office, if I may ask? (I'm new here) + Thanks, but where is Christine's office, if I may ask? (I'm new here)

]]>
comment @@ -32,7 +33,7 @@ This month you also get 250 EUR of eco-vouchers if you have been in the company mail.group - Building B3, second floor on the right :-) + Building B3, second floor on the right :-)

]]>
comment @@ -41,7 +42,7 @@ This month you also get 250 EUR of eco-vouchers if you have been in the company mail.group - Great news, I need to buy a new fridge, I think I can pay it with the eco-vouchers! + Great news, I need to buy a new fridge, I think I can pay it with the eco-vouchers!

]]>
comment diff --git a/addons/mail/data/mail_group_data.xml b/addons/mail/data/mail_group_data.xml index 11d0ee7d04b..fe24f0b8661 100644 --- a/addons/mail/data/mail_group_data.xml +++ b/addons/mail/data/mail_group_data.xml @@ -1,6 +1,7 @@ - + + Sales @@ -18,11 +19,9 @@ notification Welcome to OpenERP! - Your homepage is a summary of messages you received and key information about documents you follow. - -The top menu bar contains all applications you installed. You can use this <i>Settings</i> menu to install more applications, activate others features or give access to new users. - -To setup your preferences (name, email signature, avatar), click on the top right corner. + Your homepage is a summary of messages you received and key information about documents you follow.
+The top menu bar contains all applications you installed. You can use this <i>Settings</i> menu to install more applications, activate others features or give access to new users.
+To setup your preferences (name, email signature, avatar), click on the top right corner.

]]>
diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index bd0ade31b68..3637bb371dc 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -25,6 +25,7 @@ import tools from email.header import decode_header from openerp import SUPERUSER_ID from openerp.osv import osv, orm, fields +from openerp.tools import html_email_clean from openerp.tools.translate import _ _logger = logging.getLogger(__name__) @@ -242,7 +243,7 @@ class mail_message(osv.Model): 'id': message['id'], 'type': message['type'], 'attachment_ids': attachment_ids, - 'body': message['body'], + 'body': html_email_clean(message['body']), 'model': message['model'], 'res_id': message['res_id'], 'record_name': message['record_name'], diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index af3cc3ed359..652714bffd7 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -57,6 +57,10 @@ margin-bottom: 0px; margin-top: 2px; } +.openerp .oe_mail .oe_msg .oe_msg_content .oe_msg_body p{ + margin-top: 0px; + margin-bottom: 0px; +} /* a) Indented Messages */