summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2010-12-17 16:05:27 +0100
committerOlivier Dony <odo@openerp.com>2010-12-17 16:05:27 +0100
commit966907eaeb896e2e37ae4678cb1ffc7ecc6c2ce9 (patch)
tree5e9f5fe5c2a2b41eb102d42b3fc5b6945dfcbe33
parent5b0bb2b01b69ca0192b4e1b340c13991f42b1cc9 (diff)
[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
-rw-r--r--bin/osv/orm.py6
1 files changed, 6 insertions, 0 deletions
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