[FIX] mail: partner avatar is email_icon when there are no partner or partner_id is null

bzr revid: chm@openerp.com-20121112152753-houzjde3x8jfwtks
This commit is contained in:
Christophe Matthieu 2012-11-12 16:27:53 +01:00
parent 65e46e1826
commit 99525e3a54
2 changed files with 3 additions and 3 deletions

View File

@ -87,6 +87,7 @@ This month you also get 250 EUR of eco-vouchers if you have been in the company
<!-- External mail + reply with attachment conversation -->
<record id="message_video2" model="mail.message">
<field name="subject">Plan to install OpenERP</field>
<field name="model">mail.message</field>
<field name="body">
&lt;![CDATA[Email0 inquiry]]&gt;
&lt;div&gt;&lt;font size="2"&gt;Hello,&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;
@ -95,7 +96,6 @@ This month you also get 250 EUR of eco-vouchers if you have been in the company
Sophie
</field>
<field name="type">email</field>
<field name="subtype_id" ref="mt_comment"/>
<field name="author_id" ref="base.res_partner_2"/>
<field name="partner_ids" eval="[(6, 0, [ref('base.partner_demo'), ref('base.partner_root')])]"/>
</record>
@ -106,7 +106,7 @@ This month you also get 250 EUR of eco-vouchers if you have been in the company
<field name="name">catalogue 2012.pdf</field>
</record>
<record id="message_video2_message1" model="mail.message">
<field name="subject">Re: Plan to buy a Laptop</field>
<field name="subject">Re: Plan to install OpenERP</field>
<field name="body">
Dear Customer,&lt;br/&gt;
Thanks for showing interest in our products.&lt;br/&gt;

View File

@ -274,7 +274,7 @@ openerp.mail = function (session) {
this.date = session.web.format_value(this._date, {type:"datetime"});
this.timerelative = $.timeago(this.date);
}
if (this.type == 'email' && !this.author_id) {
if (this.type == 'email' && (!this.author_id || !this.author_id[0])) {
this.avatar = ('/mail/static/src/img/email_icon.png');
} else if (this.author_id && this.template != 'mail.compose_message') {
this.avatar = mail.ChatterUtils.get_image(this.session, 'res.partner', 'image_small', this.author_id[0]);