在OpenERP 7.0中进行调试 [英] Debugging in OpenERP 7.0

查看:71
本文介绍了在OpenERP 7.0中进行调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在OpenERP v7中进行调试?

How to do debug in OpenERP v7?

在以前的OpenERP版本中,调试起来很容易.但是在最新版本中,调试起来很困难.

In previous versions of OpenERP, it was easy to debug. But in the latest version it's tough to debug.

推荐答案

要在eclipse中调试您的OpenERP + python代码,请在debug透视图中启动eclipse(仅限helios/indigo),并按照给定的步骤进行操作:

To debug your OpenERP+python code in eclipse, start eclipse (helios/indigo only) in debug perspective and follow the given steps:

1:按下"ctr + c",停止运行openERP的服务器.

1: Stop your openERP running server by pressing "ctr+c".

2:在eclipse中,转到菜单运行/调试配置".在"Python Run"下的配置窗口中,创建新的调试配置(双击"Python Run").

2: In eclipse go to Menu "Run/Debug Configurations". In configuration window under "Python Run", create new debug configuration(Double click on 'Python Run').

3:创建新的调试配置后,请执行以下步骤:

3: After creating new debug configuration follow the given steps:

3.1:在项目"下的主"选项卡中,从工作区中选择服务器"项目或文件夹(Openerp Server所在的文件夹).

3.1: In "Main" tab under "Project", select the "server" project or folder (in which Openerp Server resides) from your workspace.

3.2:在主模块"下写入"openerp-server"的位置.

3.2: Write location of 'openerp-server' under "Main Module".

Ex: ${workspace_loc:server/openerp-server}.

3.3:在程序参数"下的参数"选项卡中,单击变量"按钮,将出现新窗口.

3.3: In "Arguments" tab under "Program Arguments", click on button "Variables" and new window will appear.

3.4:然后通过单击编辑变量"按钮创建新的变量",然后将出现新窗口.

3.4: Then create new "Variable" by clicking on "Edit Variables" button and new window will appear.

3.5:按下新建"按钮,然后将您的插件路径指定为值.

3.5: Press on "New" button and give your addons path as value.

Ex: --addons ../addons,../your_module_path

3.6:在所有打开的窗口中按确定",然后单击应用".

3.6: Press Ok in all the opened windows and then "Apply".

4:现在进入"PyDev包资源管理器"视图,转到6.1/server,然后右键单击"openerp-server"文件,选择"Debug As-> Python Run".

4: Now into "PyDev Package Explorer" view go to 6.1/server and right click on "openerp-server" file, Select 'Debug As --> Python Run'.

5:现在在控制台"中,您可以看到服务器已启动.

5: Now in "Console" you can see your server has been started.

6:现在打开要调试的.py文件并设置断点.

6: Now open your .py file which you want to debug and set a break-point.

7:现在从"gtk"或"web-client"启动模块的表单,当执行到断点时,执行将停止.

7: Now start your module's form from 'gtk' or 'web-client' and execution will stop when execution will reach to break-point.

8:现在享受通过按"F5,F6,F7"调试代码的乐趣,您可以看到变量的值.

8: Now enjoy by debugging your code by pressing "F5, F6, F7" and you can see value of your variables.

您可以引用以下链接:从Eclipse调试OpenERP代码

You can refer following link: Debug OpenERP Code from Eclipse

这篇关于在OpenERP 7.0中进行调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆