[MERGE] base_module_record: fix bug 696176, courtesy of Stefan Rijnhart (Therp)

bzr revid: odo@openerp.com-20111108152739-1fat83woor24hveo
This commit is contained in:
Olivier Dony 2011-11-08 16:27:39 +01:00
commit 41c9661d19
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' )