From 66f72fcc061f51ab4871121bbb63efea07f6e6cf Mon Sep 17 00:00:00 2001 From: "Jay Vora (OpenERP)" Date: Mon, 28 Mar 2011 20:21:27 +0530 Subject: [PATCH] [FIX] Mail_Gateway : Added a condition in order to display message with no subject arising from migration(Ref : Case 4701) bzr revid: jvo@tinyerp.com-20110328145127-qolzeo95odny4mqj --- addons/mail_gateway/mail_gateway.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index 436bf47a873..ddd2bdcdb18 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -245,21 +245,22 @@ class mailgate_message(osv.osv): result = {} for message in self.browse(cr, uid, ids, context=context): msg_txt = '' + msg_name = message.name if message.history: msg_txt += (message.email_from or '/') + _(' wrote on ') + format_date_tz(message.date, tz) + ':\n\t' if message.description: msg_txt += self.truncate_data(cr, uid, message.description, context=context) else: msg_txt = (message.user_id.name or '/') + _(' on ') + format_date_tz(message.date, tz) + ':\n\t' - if message.name == _('Opportunity'): + if msg_name == _('Opportunity'): msg_txt += _("Converted to Opportunity") - elif message.name == _('Note'): + elif msg_name == _('Note'): msg_txt = (message.user_id.name or '/') + _(' added note on ') + format_date_tz(message.date, tz) + ':\n\t' msg_txt += self.truncate_data(cr, uid, message.description, context=context) - elif message.name == _('Stage'): + elif msg_name == _('Stage'): msg_txt += _("Changed Stage to: ") + message.description - else: - msg_txt += _("Changed Status to: ") + message.name + elif msg_name: + msg_txt += _("Changed Status to: ") + msg_name result[message.id] = msg_txt return result