summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Vora (OpenERP) <jvo@tinyerp.com>2011-03-28 20:21:27 +0530
committerJay Vora (OpenERP) <jvo@tinyerp.com>2011-03-28 20:21:27 +0530
commit66f72fcc061f51ab4871121bbb63efea07f6e6cf (patch)
tree038560332dc2c3882355c3f5b8438c66dba887c6
parent3bb8aef2071fa379cb204c869256a713609a43f3 (diff)
[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
-rw-r--r--addons/mail_gateway/mail_gateway.py11
1 files 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