From 9f1015621bd3024bba5ec1cb0f544fc0b882837b Mon Sep 17 00:00:00 2001 From: "Anup (OpenERP)" Date: Thu, 13 May 2010 14:32:41 +0530 Subject: [PATCH] =?UTF-8?q?[FIX]=C2=A0Export=C2=A0:=C2=A0Correction=C2=A0m?= =?UTF-8?q?ade=C2=A0when=C2=A0selection=C2=A0field=C2=A0value=C2=A0if?= =?UTF-8?q?=C2=A0False.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bzr revid: ach@tinyerp.com-20100513090241-6gyslly3fleii1tf --- bin/osv/orm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 4973c1e50ab..efa31fddc50 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -590,9 +590,9 @@ class orm_template(object): cols = selection_field(self._inherits) if cols and cols._type == 'selection': sel_list = cols.selection - if type(sel_list) == type([]): - r = [x[1] for x in sel_list if r==x[0]][0] - + if r and type(sel_list) == type([]): + r = [x[1] for x in sel_list if r==x[0]] + r = r and r[0] or False if not r: if f[i] in self._columns: r = check_type(self._columns[f[i]]._type)