From 1d8d7b723668b3a31608fcde6d322b4c5583b6dc Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 5 Mar 2009 00:00:57 +0100 Subject: [PATCH] [IMP] orm: do not use xpath for hidding buttons when user hasn't the right role bzr revid: christophe@taupe-20090304230057-tx2ch1yfmbk0b1gb --- bin/osv/orm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index a91f5c7ba87..6017ff24057 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -872,7 +872,7 @@ class orm_template(object): rolesobj = self.pool.get('res.roles') usersobj = self.pool.get('res.users') - buttons = xpath.Evaluate("//button[@type != 'object']", node) + buttons = (n for n in node.getElementsByTagName('button') if n.getAttribute('type') != 'object') for button in buttons: ok = True if user != 1: # admin user has all roles