From 73343c5656b36c712c2e4ea973872525f05379e9 Mon Sep 17 00:00:00 2001 From: "Sanjay Gohel (Open ERP)" Date: Wed, 5 Dec 2012 10:35:13 +0530 Subject: [PATCH] [IMP]improve code bzr revid: sgo@tinyerp.com-20121205050513-c0y5rla3aqb320iv --- addons/mail/mail_thread.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 00d36b830fe..3f002c4c2ac 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -326,11 +326,14 @@ class mail_thread(osv.AbstractModel): for f in changed_fields: to = self.browse(cr, uid, ids[0], context)[f] ci = tracked[f] - if to is None: - to = "Removed" if ci.column._type == "many2one": - to = to.name - from_ = from_.name + if to: + to = to.name_get()[0][1] + else: + to = "Removed" + if from_: + from_ = from_.name_get()[0][1] + subtype = get_subtype(ci.column._obj,values[f]) chg.append((_t(ci), from_, to))