From 5c54571f4ea0b262c9a3c882c0e29c344eb36d6a Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Thu, 30 Jun 2016 16:37:13 +0200 Subject: [PATCH] [FIX] web_editor: remove the `editable key` if no write on the model The `check_access_rule` call allow to remove the `editable` key from the rendering context (which will lead to the display of the editor bar) if an access rule prevents the edition of the ir.ui.view record. Also remove it in case the user has no write access on the model (i.e. demo user). --- addons/web_editor/models/ir_ui_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/models/ir_ui_view.py b/addons/web_editor/models/ir_ui_view.py index d7bf92b1cab..f770a40d980 100644 --- a/addons/web_editor/models/ir_ui_view.py +++ b/addons/web_editor/models/ir_ui_view.py @@ -22,7 +22,7 @@ class view(osv.osv): if '.' not in id_or_xml_id: raise ValueError('Invalid template id: %r' % (id_or_xml_id,)) id_or_xml_id = self.get_view_id(cr, uid, id_or_xml_id, context=context) - + self.check_access_rights(cr, uid, 'write') self.check_access_rule(cr, uid, [id_or_xml_id], 'write', context=context) except AccessError: