How to do debugging in odoo browser in browser

How to debug "Odoo" in Chrome and Firefox?

Someone will provide information, it will be great.

Thank you in advance

+6
source share
6 answers

Your question is not very clear to me, but if you want to enter odoo's built-in debugging mode, you need to add ?debug to the URL right after /web . For example http://odoo.your-site.com/web?debug .

In this special mode, you get a debug menu with various technical parameters:

debugging menu in odoo

In addition, when you are in debug mode, odoo does not minimize JS files, which allows you to easily use the built-in JavaScript browser debugging tools.

+4
source

You can open the console in a browser (using the F12 key). It will display each request and response with a value.

If you use chrome, you need to activate logXMLHTTPREQUEST in the console. To activate each request and response, you can right-click on the console and click on the logXMLHTTPREQUEST parameter.

+2
source

This is how I do it in linux

Stop your server as a daemon /etc/init.d/openerp stop

Place the python debugger inside the .py odoo file you want to debug and execute.

 import pdb; pdb.set_trace() 

start your server from the command line as an openerp user. / server / openerp -server --database = DB_NAME

access your program from the browser and it will break when I get to your python debugger

+1
source

Open the console (CTRL + SHIFT + I), and then get the broker object to the server model that you want to access (in this example, the "Leading"):

 var Leads = new openerp.Model('crm.lead'); 

In openerp v7.0 you can get a broker like this:

 var instance = openerp.instances.instance0 var Leads = new instance.web.Model('crm.lead') 

After that, make your request, filter the results and indicate what you want to do with the list of objects (in this case, the counter):

 Leads.query(['id']).all().then(function(leads){console.log(leads.length)}) 

in this case, shows the Id of the first:

 Leads.query(['id']).first().then(function(lead){console.log(lead.id)}) 

More samples and documents for odoo:

https://www.odoo.com/documentation/8.0/reference/javascript.html#rpc

Additional examples and documents for openerp:

http://openerp-web-v7.readthedocs.org/en/latest/testing.html#rpc

+1
source

ODOO debugging menu

You need to activate "Debugging resources" to make Javascript debugged from QWEB (assets). You need to enable odoo debugging mode to see the debug button.

0
source

You can use the extension below in Chrome to debug odoo.

 https://chrome.google.com/webstore/detail/odoo-debug/hmdmhilocobgohohpdpolmibjklfgkbi?hl=en 
0
source

Source: https://habr.com/ru/post/976107/


All Articles