[FIX] handling of multiple children in an HTML field

bzr revid: xmo@openerp.com-20130923145744-3dpta6w2qnqe851b
This commit is contained in:
Xavier Morel 2013-09-23 16:57:44 +02:00
parent f040cfc7b1
commit d71a200543
1 changed files with 5 additions and 2 deletions

View File

@ -70,8 +70,11 @@ class view(osv.osv):
column_type = type_override or type(column)
if issubclass(column_type, fields.html):
# FIXME: multiple children?
return html.tostring(el[0])
content = []
if el.text: content.append(el.text)
content.extend(html.tostring(child)
for child in el.iterchildren(tag=etree.Element))
return '\n'.join(content)
elif issubclass(column_type, fields.integer):
return int(el.text_content())
elif issubclass(column_type, fields.float):