English 中文(简体)
How to debug python Code in OpenERP 6.1
原标题:How to debug python code in OpenERP 6.1
  • 时间:2012-04-10 11:30:38
  •  标签:
  • python
  • odoo

I am working with OpenERP 6.1 and i am not able to debug the python code by giving print statements in the python code.

This was quite easy/possible with OpenERP 6.0 where we give the server path followed by module name and database name to debug the code.

怎么能用公开的ERP 6.1来做到这一点?

Please help!! Thanks in advance..

问题回答

亲爱的朋友可以安装管道。 利用你,可以迅速击退6.1起开端。 恳请你事先安装这些包裹。

sudo apt-get install python-dateutil python-feedparser python-gdata python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi

I took this list from http://www.theopensourcerer.com/2012/02/22/how-to-install-openerp-6-1-on-ubuntu-10-04-lts/

你们也可以尝试药店。

ec击你的开放式+python代码,从欺骗的角度着手,并遵循既定步骤:

1. 通过紧急“加速+c”停止开放式ERP运行服务器

2 在单体字体上“Run/Debug Configurations”。 在“Python Run”栏下的配置窗口中,建立了新的变幻组合(Double,向Adhur和Run)。

3. 在设立新的辩论小组之后,采取了以下步骤:

3.1: 在“项目”下的“Main”表格中,从你的工作空间选择“服务器”项目或文件夹(开放式服务器在其中居住)。

3.2: “Main 模块”下的开普服务器的核销地点。

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

3.3:在“Program Arguments”栏下的“Arguments”中,点击纽顿“Variables”,新窗口将出现。

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

3.5:关于“新"子”的新闻,使你的附加物成为价值。

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

3.6:新闻 在开放的所有窗户中打O,然后是“Apply”。

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:现在,在“青少年”中,你可以看到服务器已经启动。

6:现在打开你想要解冻的书本,并立下一个断点。

7: 现在,从顶板或网络客户开始使用你的模块,执行将停止,届时执行将达到断点。

8:现在,通过“F5、F6、F7”来制定你的法典,你可以看到你变量的价值。

我在 Eclipse

--addons-path ${workspace_loc:openerp-addons-trunk},${workspace_loc:openerp-web-trunk}/addons --config ${workspace_loc:openerp-config/src/server.config}

我认为,两个突破点最有用,是太平洋共同体呼吁的结尾。 在服务器方面,我在http://bazaar.apppad.net/~ openerp/ openobject-server/6.1/view/4327/ openerp/netsvc.py#L344” rel=“nofollow”>netsvc.dispad_rpc()<>>>>>>>>><>>>>>>>>><>>><>>>>>>>

result = ExportService.getService(service_name).dispatch(method, params)

I don t debug the client as often, and not all requests come through the same path, but one useful breakpoint is the first line of rpc.tinySocket_gw.execute().

Of course, both these breakpoints see a lot of traffic, so I only use them if I m exploring some feature I m not familiar with, and I don t know where the code will execute. It can also be useful to put a condition on the breakpoint so it only triggers when a request comes through for a specific model or parameter value.

Here is the config file I use:

[options]
debug_mode = False

admin_passwd = ******
db_user = ******
db_password = *******
price_accuracy = 5
smtp_server = **********
ftp_server_port = 8022
ftp_server_passive_ports = 8192:8447
translate_data = False
#log_level = debug_rpc_answer

检查:

logfile = None

在您的公开服务器中,通过标准产出使您的标识得以实现。

这是否有助于?

第一:<编码> 进口伐木

Then :

def ExampleFunction(self,cr,uid,ids,context):
        log = logging.getLogger("ExampleClass -- ExampleFunction")
        log.info( test ) 
        return True

And in your openerp folder /server/server/openerp-server.log file you will see the log.info content here ( ExampleClass -- ExampleFunction: test)





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签