this.$('#website-top-edit').hide();
this.$('#website-top-view').show();
+ var $edit_button = this.$('button[data-action=edit]')
+ .prop('disabled', website.no_editor);
if (website.no_editor) {
var help_text = $(document.documentElement).data('editable-no-editor');
- this.$('button[data-action=edit]')
- .prop('disabled', website.no_editor)
- .parent()
+ $edit_button.parent()
// help must be set on form above button because it does
// not appear on disabled button
.attr('title', help_text);
cr = qwebcontext.get('request') and qwebcontext['request'].cr or None
uid = qwebcontext.get('request') and qwebcontext['request'].uid or None
can_see = self.user_has_groups(cr, uid, groups=attribute_value) if cr and uid else False
- if can_see:
- continue
- if qwebcontext.get('editable') and not qwebcontext.get('editable_no_editor'):
- errmsg = _("Editor disabled because some content can not be seen by a user who does not belong to the groups %s")
- raise openerp.http.Retry(
- _("User does not belong to groups %s") % attribute_value, {
- 'editable_no_editor': errmsg % attribute_value
- })
- return ''
+ if not can_see:
+ if qwebcontext.get('editable') and not qwebcontext.get('editable_no_editor'):
+ errmsg = _("Editor disabled because some content can not be seen by a user who does not belong to the groups %s")
+ raise openerp.http.Retry(
+ _("User does not belong to groups %s") % attribute_value, {
+ 'editable_no_editor': errmsg % attribute_value
+ })
+ return ''
if isinstance(attribute_value, unicode):
attribute_value = attribute_value.encode("utf8")