4

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

Oumar Diarra
  • 355
  • 4
  • 16

2 Answers2

1

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.

Mariusz Mizgier
  • 527
  • 2
  • 13
  • You meant that Odoo doesn't work with Python 3.4.1? ;-) – CZoellner Aug 10 '16 at 15:10
  • hi @Mizgier, i don't have Openerp-server in Odoo installation but server instead. In script i added C:\Program Files (x86)\Odoo 8.0-20150408\server . Also i already have source folder in project structure. Now i hit debug i got Permission denied. Pycharm is runing with admin role – Oumar Diarra Aug 10 '16 at 15:59
  • @CZoellner Yes, i meant that it won't work with 3.4.1 OumarDiarra You have to download sources from https://github.com/odoo/odoo to run Odoo via PyCharm and not all-in-one package for it to work. – Mariusz Mizgier Aug 10 '16 at 19:40
  • thank you @MariuszMizgier. Now i don't have any error. But seems that i cannot reach a breakpoint. I've updated my question. Thanks again – Oumar Diarra Aug 11 '16 at 17:05
0

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
vsminkov
  • 10,912
  • 2
  • 38
  • 50