[FIX] yaml_import: support False as a o2m default value

bzr revid: odo@openerp.com-20120625144013-r6j6zabaap6739gf
This commit is contained in:
Olivier Dony
2012-06-25 16:40:13 +02:00
parent a320a72cf8
commit e3f997c44d
+4 -3
View File
@@ -370,11 +370,12 @@ class YamlInterpreter(object):
if type(val) in (tuple,list):
val = val[0]
elif fg[key]['type'] == 'one2many':
if len(val) and type(val[0]) == dict:
if val and isinstance(val,(list,tuple)) and \
isinstance(val[0], dict):
val = map(lambda x: (0,0,x), val)
elif fg[key]['type'] == 'many2many':
if val and isinstance(val,(list,tuple)):
if isinstance(val[0], (int,long)):
if val and isinstance(val,(list,tuple)) and \
isinstance(val[0], (int,long)):
val = [(6,0,val)]
return val