How to disable developer mode or debugging feature in openerp 7

How can I disable debugging mode or developer mode for users other than admin? I tried to remove the link 'Activate developer mode', but the problem was if the user types '?debug' after server address and port in the address bar of browser, then the user is able to use debugging feature.

First of all you need to create one custom module and then follow the steps.

Create file under your_module/static/src/base.xml and write the following code:

<templates>
    <t t-extend="UserMenu.about">
        <t t-jquery="a.oe_activate_debug_mode" t-operation="replace"/>
    </t>
</templates>

Add this file in __openerp__.py:

'qweb' : [
    "static/src/xml/base.xml",
],

This code will remove Activate the Developer Mode option for all user.


Following code will disable debug mode (Drop-down box) if user is admin (admin ID must be 1. If not then change session.uid === your_admin_id):

Create one xml file inside your_module/static/src/xml folder and add following code:

<templates>
    <t t-extend="ViewManagerAction">
        <t t-jquery="select.oe_debug_view" t-operation="replace">
            <select t-if="widget.session.uid === 1 and widget.session.debug" class="oe_debug_view"/>
        </t>
    </t>
</templates>

Now go to __openerp__.py and add your xml file under qweb.

Like this:

'qweb' : [
    "static/src/xml/your.xml",
],

Restart your server, update your module and refresh the page.


You can refer this blog: OpenERP Web Changes.

Need more info?

This documentation page has been extracted from the Q&A section where you can discuss it and get feedback.
Related question