diff --git a/addons/report/models/report.py b/addons/report/models/report.py index cbbee7fcebd..17635688063 100644 --- a/addons/report/models/report.py +++ b/addons/report/models/report.py @@ -134,14 +134,15 @@ class Report(osv.Model): website = None if request and hasattr(request, 'website'): website = request.website - values.update({ - 'time': time, - 'translate_doc': translate_doc, - 'editable': True, # Will active inherit_branding - 'user': user, - 'res_company': user.company_id, - 'website': website, - }) + values.update( + time=time, + translate_doc=translate_doc, + editable=True, # Will active inherit_branding + user=user, + res_company=user.company_id, + website=website, + editable_no_editor=True, + ) return view_obj.render(cr, uid, template, values, context=context) #-------------------------------------------------------------------------- diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index fcb957cafda..601d3016068 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -3,6 +3,7 @@ var website = openerp.website; var _t = openerp._t; + website.no_editor = !!$(document.documentElement).data('editable-no-editor'); website.add_template_file('/website/static/src/xml/website.editor.xml'); website.dom_ready.done(function () { @@ -496,6 +497,17 @@ 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'); + $edit_button.parent() + // help must be set on form above button because it does + // not appear on disabled button + .attr('title', help_text); + } + + $('.dropdown-toggle').dropdown(); this.customize_setup(); diff --git a/addons/website/static/src/xml/website.xml b/addons/website/static/src/xml/website.xml index 4d9c9fcd73d..684a46a9f43 100644 --- a/addons/website/static/src/xml/website.xml +++ b/addons/website/static/src/xml/website.xml @@ -14,7 +14,8 @@