我该如何在Eclipse中调试openerp代码 [英] how can i debug openerp code in to the eclipse
问题描述
我该如何调试python代码到eclipse中.如果可以完成,那么我们将花费更少的精力并快速地完成工作.任何人都可以告诉我吗?
how can I debug python code in to the eclipse.if it will be done then we face less effort and fast do our work.can any one tell me???
推荐答案
要在eclipse中调试您的Openerp + python代码,请在debug透视图中启动eclipse并按照给定的步骤进行操作:
To debug your Openerp+python code in eclipse, start eclipse 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".
例如:$ {workspace_loc:server/openerp-server}.
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.
例如:--addons ../addons,../your_module_path
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代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!