[IMP] Improve code for return value of selection field.

bzr revid: bth@tinyerp.com-20120917110346-0daw7ho3y31zbpu3
This commit is contained in:
Bhumi Thakkar (Open ERP)
2012-09-17 16:33:46 +05:30
parent c7fc374a8e
commit 29ff1bf82a
+3
View File
@@ -53,6 +53,9 @@ class GraphView(View):
if fields[field]['type']=='many2one':
data = data and data[1]
if tick:
if fields[field]['type']=='selection':
d = dict(fields[field]['selection'])
data = d[data]
return ticks.setdefault(data, len(ticks))
return data or 0