From d71a20054305e99a6246b08bbfd4e40a736022d0 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 23 Sep 2013 16:57:44 +0200 Subject: [PATCH] [FIX] handling of multiple children in an HTML field bzr revid: xmo@openerp.com-20130923145744-3dpta6w2qnqe851b --- addons/website/view.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/website/view.py b/addons/website/view.py index 8b3da581732..1c91914ff2f 100644 --- a/addons/website/view.py +++ b/addons/website/view.py @@ -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):