[FIX] yaml_import: support False as a o2m default value
bzr revid: odo@openerp.com-20120625144013-r6j6zabaap6739gf
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user