如何在像Chrome和Firefox这样的浏览器中特别调试"Odoo"?
是否有人可以提供相关信息,将会非常有帮助。
提前感谢您的帮助。
?debug
,紧跟着/web
。例如:http://odoo.your-site.com/web?debug
。您可以在浏览器中打开控制台(使用F12键)。它将显示每个请求和响应的值。
如果您正在使用Chrome,则需要在控制台中激活logXMLHTTPREQUEST。要激活每个请求和响应,您可以右键单击控制台,然后单击logXMLHTTPREQUEST选项。
var Leads = new openerp.Model('crm.lead');
var instance = openerp.instances.instance0
var Leads = new instance.web.Model('crm.lead')
Leads.query(['id']).all().then(function(leads){console.log(leads.length)})
Leads.query(['id']).first().then(function(lead){console.log(lead.id)})
更多Odoo的示例和文档:
https://www.odoo.com/documentation/8.0/reference/javascript.html#rpc
更多的OpenERP样例和文档:http://openerp-web-v7.readthedocs.org/en/latest/testing.html#rpc
停止作为守护进程运行的服务器 /etc/init.d/openerp stop
将Python调试器放置在您想要调试和逐步执行的Odoo .py文件中。
import pdb; pdb.set_trace()
以openerp用户身份从命令行启动您的服务器
./server/openerp-server --database=DB_NAME
通过浏览器访问程序,当它到达您的Python调试器时会中断
您可以在Chrome中使用以下扩展程序来调试Odoo。
https://chrome.google.com/webstore/detail/odoo-debug/hmdmhilocobgohohpdpolmibjklfgkbi?hl=en