[IMP] mail: displayed messages now goe through html_email_clean to clean their content; added a css because we now have lots of <p> in chatter messages, and default margin is quite big (to be improved maybe); updated demo data.

bzr revid: tde@openerp.com-20121107085926-9g609zgmkg4kieqc
This commit is contained in:
Thibault Delavallée 2012-11-07 09:59:26 +01:00
parent 6d0b416980
commit c0e139bd4b
4 changed files with 19 additions and 14 deletions

View File

@ -1,12 +1,13 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<!-- <data noupdate="1"> -->
<data>
<record id="message_blogpost0" model="mail.message">
<field name="model">mail.group</field>
<field name="res_id" ref="mail.group_all_employees"/>
<field name="body">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.</field>
<field name="body"><![CDATA[<p>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.</p>]]></field>
<field name="type">comment</field>
<field name="subtype_id" ref="mt_comment"/>
</record>
@ -14,7 +15,7 @@ This month you also get 250 EUR of eco-vouchers if you have been in the company
<record id="message_blogpost0_comment0" model="mail.message">
<field name="model">mail.group</field>
<field name="res_id" ref="group_all_employees"/>
<field name="body"><![CDATA[Great.]]></field>
<field name="body"><![CDATA[<p>Great.</p>]]></field>
<field name="parent_id" ref="message_blogpost0"/>
<field name="type">comment</field>
<field name="subtype_id" ref="mt_comment"/>
@ -23,7 +24,7 @@ This month you also get 250 EUR of eco-vouchers if you have been in the company
<record id="message_blogpost0_comment1" model="mail.message">
<field name="model">mail.group</field>
<field name="res_id" ref="group_all_employees"/>
<field name="body">Thanks, but where is Christine's office, if I may ask? (I'm new here)</field>
<field name="body"><![CDATA[<p>Thanks, but where is Christine's office, if I may ask? (I'm new here)</p>]]></field>
<field name="parent_id" ref="message_blogpost0"/>
<field name="type">comment</field>
<field name="subtype_id" ref="mt_comment"/>
@ -32,7 +33,7 @@ This month you also get 250 EUR of eco-vouchers if you have been in the company
<record id="message_blogpost0_comment2" model="mail.message">
<field name="model">mail.group</field>
<field name="res_id" ref="group_all_employees"/>
<field name="body">Building B3, second floor on the right :-)</field>
<field name="body"><![CDATA[<p>Building B3, second floor on the right :-)</p>]]></field>
<field name="parent_id" ref="message_blogpost0"/>
<field name="type">comment</field>
<field name="subtype_id" ref="mt_comment"/>
@ -41,7 +42,7 @@ This month you also get 250 EUR of eco-vouchers if you have been in the company
<record id="message_blogpost0_comment3" model="mail.message">
<field name="model">mail.group</field>
<field name="res_id" ref="group_all_employees"/>
<field name="body">Great news, I need to buy a new fridge, I think I can pay it with the eco-vouchers!</field>
<field name="body"><![CDATA[<p>Great news, I need to buy a new fridge, I think I can pay it with the eco-vouchers!</p>]]></field>
<field name="parent_id" ref="message_blogpost0"/>
<field name="type">comment</field>
<field name="subtype_id" ref="mt_comment"/>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<!-- <data noupdate="1"> -->
<data>
<record model="mail.group" id="group_sales">
<field name="name">Sales</field>
@ -18,11 +19,9 @@
<field name="res_id" ref="mail.group_all_employees"/>
<field name="type">notification</field>
<field name="subject">Welcome to OpenERP!</field>
<field name="body">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 &lt;i&gt;Settings&lt;/i&gt; 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.</field>
<field name="body"><![CDATA[<p>Your homepage is a summary of messages you received and key information about documents you follow.<br />
The top menu bar contains all applications you installed. You can use this &lt;i&gt;Settings&lt;/i&gt; menu to install more applications, activate others features or give access to new users.<br />
To setup your preferences (name, email signature, avatar), click on the top right corner.</p>]]></field>
</record>
</data>
</openerp>

View File

@ -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'],

View File

@ -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 */