[IMP]improve code

bzr revid: sgo@tinyerp.com-20121205050513-c0y5rla3aqb320iv
This commit is contained in:
Sanjay Gohel (Open ERP)
2012-12-05 10:35:13 +05:30
parent c850d5eac4
commit 73343c5656
+7 -4
View File
@@ -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))