Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

6

How to disable developer mode or debugging feature in openerp 7 [Closed]

By
Omal Bastin
on 4/10/13, 11:25 AM 12,137 views

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.

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

Nicholas Burdick
on 6/7/13, 6:20 PM
This question has been included in the official documentation.
6

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 6/9/13, 9:34 AM

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.

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?

Nicholas Burdick
on 6/10/13, 1:21 AM
This question has been included in the official documentation.
11

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 4/10/13, 11:58 AM

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.

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.

Omal Bastin
on 4/10/13, 2:20 PM

See my updated answer.

Sudhir Arya (SA)
on 4/18/13, 10:24 AM

It really works. :) Thanks a lot.

Sasuke
on 4/21/13, 11:00 AM

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.

Martin
on 4/23/13, 8:41 AM
This question has been included in the official documentation.
4

Bonnet Denis

--Bonnet Denis--
925
| 5 6 8
Vannes, France
--Bonnet Denis--

Engeneer at MGS Consulting Ouest at Vannes, FRANCE

Bonnet Denis
On 4/10/13, 11:38 AM

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

easy way :) thanks :)

Sreedath Namangalam
on 5/3/13, 3:28 AM

great, thanks

PT ADU(Adsoft), Iman Sulaiman
on 9/23/13, 9:59 AM
This question has been included in the official documentation.
0
pankaj
On 9/18/14, 10:39 AM

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

This question has been included in the official documentation.
0

Martin

--Martin--
1978
| 5 6 8
Cornwall, Canada
--Martin--

Analysing, designing, coding and mentoring since 1975. Kilobytes to terabytes. Punch cards to punchy sites. My OpenERP video series: http://www.youtube.com/playlist?list=PLq7op4J183lX44ZlXPiHxUpRvmmRDtxye My Google Speadsheets --> OpenERP Data Pump project: http://martinhbramwell.github.io/GData_OpenERP_Data_Pump My email (with spaces removed) : mhb . warehouseman @ gmail . com

Martin
On 4/10/13, 11:56 AM

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

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 4/10/13, 11:25 AM
Seen: 12137 times
Last updated: 3/16/15, 8:10 AM