From 966907eaeb896e2e37ae4678cb1ffc7ecc6c2ce9 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 17 Dec 2010 16:05:27 +0100 Subject: [PATCH] [FIX] fields_view_get: ignore non-element nodes during view inheritance resolution lp bug: https://launchpad.net/bugs/494969 fixed bzr revid: odo@openerp.com-20101217150527-4mv740mppqimvsnd --- bin/osv/orm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index a652ad54f04..aa5835414fd 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -70,6 +70,10 @@ POSTGRES_CONFDELTYPES = { 'SET DEFAULT': 'd', } +# List of etree._Element subclasses that we choose to ignore when parsing view architecture. +# We include the *Base ones just in case, currently they seem to be subclasses of the _* ones. +SKIPPED_ELEMENT_TYPES = (etree._Comment, etree._ProcessingInstruction, etree.CommentBase, etree.PIBase) + def last_day_of_current_month(): today = datetime.date.today() last_day = str(calendar.monthrange(today.year, today.month)[1]) @@ -1614,6 +1618,8 @@ class orm_template(object): while len(toparse): node2 = toparse.pop(0) + if isinstance(node2, SKIPPED_ELEMENT_TYPES): + continue if node2.tag == 'data': toparse += [ c for c in doc_dest ] continue