[FIX] allows XML exports of fields.selection with integer key

lp bug: https://launchpad.net/bugs/696176 fixed

bzr revid: stefan@therp.nl-20110929100802-1fsffcccsul0n24a
This commit is contained in:
Stefan Rijnhart 2011-09-29 12:08:02 +02:00
parent bdfaf1e37d
commit e2bacf12cd
1 changed files with 2 additions and 1 deletions

View File

@ -104,7 +104,8 @@ class base_module_record(osv.osv):
for key,val in data.items():
if not (val or (fields[key]['type']=='boolean')):
continue
if fields[key]['type'] in ('integer','float'):
if (fields[key]['type'] in ('integer','float') or
fields[key]['type'] == 'selection' and isinstance(val, int)):
field = doc.createElement('field')
field.setAttribute("name", key)
field.setAttribute("eval", val and str(val) or 'False' )