[FIX] import of boolean fields in csv files.

lp bug: https://launchpad.net/bugs/415257 fixed
lp bug: https://launchpad.net/bugs/406945 fixed

bzr revid: christophe@tinyerp.com-20090818154334-blcft3nkwidckjz3
This commit is contained in:
Christophe Simonis 2009-08-18 17:43:34 +02:00
parent e036492669
commit eb15785f7b
1 changed files with 1 additions and 1 deletions

View File

@ -662,7 +662,7 @@ class orm_template(object):
if fields_def[field[len(prefix)]]['type'] == 'integer':
res = line[i] and int(line[i])
elif fields_def[field[len(prefix)]]['type'] == 'boolean':
res = line[i] and bool(line[i])
res = line[i].lower() not in ('0', 'false', 'off')
elif fields_def[field[len(prefix)]]['type'] == 'float':
res = line[i] and float(line[i])
elif fields_def[field[len(prefix)]]['type'] == 'selection':