summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2016-08-02 17:46:25 +0200
committerqsm-odoo <qsm@odoo.com>2016-08-03 10:41:12 +0200
commita1e1e27ec8a4bf955eaae9169c915a8394e5c8a5 (patch)
tree8ac7f07e2d9b43e6d3242defc2643209fe56a23e
parent77fad18f8aff1c52eb86600b1dbead04f1b0cd20 (diff)
[FIX] base: deletion of elements with attribute 'groups'
The test made to perform the deletion was not correctly migrated (see https://github.com/odoo/odoo/commit/4ddc32313996c8cf6e8e6dffd2253aad8a144ccf#diff-3ad2ad1e9b88257a01a42d04ca1c0605L274): the user to test must be the request user and not the qwebcontext user. Thanks to @rco-odoo.
-rw-r--r--openerp/addons/base/ir/ir_qweb.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/openerp/addons/base/ir/ir_qweb.py b/openerp/addons/base/ir/ir_qweb.py
index 3a572878d28..bc71fdcf3b8 100644
--- a/openerp/addons/base/ir/ir_qweb.py
+++ b/openerp/addons/base/ir/ir_qweb.py
@@ -259,8 +259,8 @@ class QWeb(models.AbstractModel):
for (attribute_name, attribute_value) in element.attrib.iteritems():
attribute_name = unicode(attribute_name)
if attribute_name == "groups":
- can_see = (qwebcontext.cr and qwebcontext.uid and
- qwebcontext.env['ir.qweb'].user_has_groups(attribute_value))
+ env = qwebcontext.get('request') and qwebcontext['request'].env
+ can_see = (env and env.cr and env.uid and env['ir.qweb'].user_has_groups(attribute_value))
if not can_see:
return element.tail and self.render_tail(element.tail, element, qwebcontext) or ''