[FIX] convert: avoid treating XML comments as real nodes when loading views

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

bzr revid: odo@openerp.com-20101222164515-k60bq20jzngnnghv
This commit is contained in:
Olivier Dony 2010-12-22 17:45:15 +01:00
parent 25d6d96be8
commit 1ba93c18e1
1 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ import netsvc
import osv
import pooler
from config import config
from osv.orm import except_orm
from osv.orm import except_orm, SKIPPED_ELEMENT_TYPES
from tools.translate import _
from yaml_import import convert_yaml_import
@ -93,8 +93,8 @@ def _fix_multiple_roots(node):
As a convention we'll surround multiple root with a container "data" element, to be
ignored later when parsing.
"""
if len(node) > 1:
real_nodes = [x for x in node if not isinstance(x, SKIPPED_ELEMENT_TYPES)]
if len(real_nodes) > 1:
data_node = etree.Element("data")
for child in node:
data_node.append(child)