4
votes

i've installed pycharm community edition 2016.

I tried to configure it to debug Odoo as illustrated in the capture

enter image description here

When i open a python file set a breakpoint and click debug icon i got an exception:

enter image description here

Also openerp, fields, api are underlined in red.

Any suggestions please. I use windows 8.1 as OS

Update:

According to Mariusz Answer , i'm now able to clic on debug bouton without any error.

Now i have put a brekpoint on a code to follow the execution, but the breakpoint is never reached ( the code is inside a buton method) while the method is executed. I can see the result in odoo page.

enter image description here

2

2 Answers

1
votes

First question - you are not supposed to run it from exe file, but from openerp-server, which is located in odoo installation folder via python interpreter. What is more, your configuration is wrong, because Odoo does not work with Python 3.4.1 My configuration looks like this: enter image description here Second question - you need to add your sources folder in Project Structure configuration so it is recognized by PyCharm as a folder from which to import.

0
votes

To be able to reach breakpoint you have to disable gevent. At the moment of writing you can do it by commenting this piece of code in openerp/__init__.py

import sys
evented = False
#if sys.modules.get("gevent") is not None:
#    evented = True