How to do debugging in odoo on browser
Solution 1
Your question is not very clear to me, but if you want to enter the built-in odoo debug mode you need to add ?debug
to the URL, right after /web
. For example http://odoo.your-site.com/web?debug
.
When in this special mode you get a debug menu, with various technical options:
Also, when you are in debug mode odoo doesn't minify the JS files, allowing you to use built-in browser JavaScript debug tools more easily.
Solution 2
You can open the console in browser(using F12 key). It will display each request and response with value.
If you are using chrome then you need to activate the logXMLHTTPREQUEST in console. For activate each request and response you can Right click on console and click on logXMLHTTPREQUEST option.
Solution 3
This is how i do it in linux
Stop your server from running as a daemon /etc/init.d/openerp stop
Put the python debugger inside the .py file of odoo you want to debug and step through.
import pdb; pdb.set_trace()
start your server from the command line as the openerp user ./server/openerp-server --database=DB_NAME
access your program from the browser and it will break when i reaches your python debugger
Solution 4
Open the console (CTRL+SHIFT+I) and then get the broker object to the server model you want to access (in this sample "Leads"):
var Leads = new openerp.Model('crm.lead');
In openerp v7.0 you can get the broker this way:
var instance = openerp.instances.instance0
var Leads = new instance.web.Model('crm.lead')
After that make your query, filter the results and specify what you want to do with the object list (in this case count):
Leads.query(['id']).all().then(function(leads){console.log(leads.length)})
in this case show the Id of the first:
Leads.query(['id']).first().then(function(lead){console.log(lead.id)})
More samples and docs for odoo:
https://www.odoo.com/documentation/8.0/reference/javascript.html#rpc
More samples and docs for openerp:
http://openerp-web-v7.readthedocs.org/en/latest/testing.html#rpc
user1576199
Email: [email protected] http://www.codecademy.com/jamesbaleme
Updated on June 13, 2022Comments
-
user1576199 almost 2 years
How to debug in "Odoo" special in browses like Chrome and Firefox???
Would anybody provide information, it will be great.
Thanks in advance