[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).
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user