Help

How to disable developer mode or debugging feature in openerp 7

Closed
Avatar
Omal Bastin

The question has been closed

by
Omal Bastin
on 06/10/2013 03:58:56

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.

1 Comment
Avatar
Discard
Avatar
Nicholas Burdick
-

Was this question correctly answered? I don't think the single answer below is really an answer to the question. I too would like to know how to disable it. It seems like there should be a way to disable developer mode for anyone but an admin

5 Answers
9

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.

1 Comment
Avatar
Discard
Avatar
Nicholas Burdick
-

You mentioned above, "This code will remove Activate the Developer Mode option for all user." Is there a way of doing it for only non-admin users?

13

Create file under static/src/base.xml and write this code:

<templates>
<t t-extend="UserMenu.about">
    <t t-jquery="div.oe_about" t-operation="replace">
        <div class="oe_about">
            <img class="oe_logo" src="/web/static/src/img/logo2.png"/>
              <h3>Version <t t-esc="version_info.server_version"/></h3>
              <div class="oe_bottom">
                <p>Copyright © 2004-TODAY OpenERP SA. All Rights Reserved.<br />
                    OpenERP is a trademark of the <a target="_blank" href="http://openerp.com/" style="text-decoration: underline;">OpenERP SA Company</a>.</p>
                <p>Licenced under the terms of <a target="_blank" href="http://www.gnu.org/licenses/agpl.html" style="text-decoration: underline;">GNU Affero General Public License</a></p>
                <p>For more information visit <a target="_blank" href="http://openerp.com/" style="text-decoration: underline;">OpenERP.com</a></p>
              </div>
        </div>
    </t>
</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 === 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.

Reference: OpenERP-7 Web Changes.

4 Comments
Avatar
Discard
Avatar
Omal Bastin
-

Thanks Arya. But it only removes the link. I have done this.the user still able to get the developer mode/debugging feature by typing in "?debug" in the address bar. is it possible to completely remove this feature for users other than admin.

See my updated answer.

Avatar
Sasuke
-

It really works. :) Thanks a lot.

Avatar
Martin
-

The purpose of the numbers, arrows and checkboxes in the left margin is so you can give credit where credit is due. Especially, clicking the checkbox lets other people know that the answer is correct without having to read through all the text. To people who might have an answer, that they don't have to waste their time continuing to try to help.

4
Avatar
Bonnet Denis
Best Answer

You have to erase the &debug= string from url. I don't know other way to turn off debug mode.

2 Comments
Avatar
Discard

easy way :) thanks :)

Avatar
Iman Sulaiman
-

great, thanks

0
Avatar
Martin
Best Answer

When you activate developer mode you will see a new phrase appear in the URL debug=#. deleting that will get you back to normal.

Avatar
Discard
0
Avatar
pankaj
Best Answer

if u want to disable the developer mode,follow thses steps:

1)juz change debug_mode = True to debug_mode = False in openerp-server.conf file

2)restart the server

thats it...it worked for me in openerp7

Avatar
Discard