[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.
This commit is contained in:
qsm-odoo
2016-08-03 10:41:12 +02:00
parent 77fad18f8a
commit a1e1e27ec8
+2 -2
View File
@@ -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 ''