Simple howto debugging openerp7 with intellij idea on windows


Prerequests:

  • installed IntelliJ Idea 12
  (www.jetbrains.com/idea/download/)
  • installed Openerp7 openerp-allinone-setup-7.0-latest.exe
  (www.openerp.com/start?download)

Step by step:

  • install intellij python plugin
  file->settings->plugins->install jetbrains plugins->python->install
  • download and install python 2.6 (i prefere portable version)
  portablepython.com/wiki/PortablePython1.1Py2.6.1/
  • copy listed files from portable python (F:\PortableApps\PortablePython_1.1_py2.6.1\App\)
  to openerp (F:\OpenERP 7.0-20130731-231106\Server\server\):
  python.exe
  Lib\site.py
  Lib\Queue.py
  Lib\trace.py
  • create new python project (openerp7debug) and configure python sdk
  file->new project->python module->openerp7debug->next->Python Interpreter->Configure-> +
  ->Python SDK->local->F:\OpenERP 7.0-20130731-231106\Server\server\python.exe->next->finish
  • right click openerp7debug->new->python file->openerp-server.py->add content

    import openerp
    if __name__ == "__main__":
        openerp.cli.main()

   

- create debug configuration
  Edit configuration...-> + -> Python->Name: Debug openerp7->Script: F:\Users\orlov\YandexDisk\Work\openerp7debug\openerp-server.py->
  Script parameters: "–config=F:\OpenERP 7.0-20130731-231106\Server\server\openerp-server.conf"->
  Working directory: F:\OpenERP 7.0-20130731-231106\Server\server->OK
  • add breakpoint (on line openerp.cli.main() for example) and click debug, test breakpoints, inspect vars, test UI from browser
  • Happy debugging!
2 comments
Hi,

Many thanks for your tutorial!

I want to debug OpenERP using PyCharm, but I get import errors.

I had setup PyCharm according to your description. Now I try to debug "openerp-server.py" file.

1) If I copy python.exe from "Portable Python 3.2.5.1" to approriate OpenERP directory and specify Python interpreter C:/Program Files (x86)/OpenERP 7.0-20140622-231040/Server/server/python.exe I get the following error:

Process finished with exit code -1073741515 (0xC0000135)

---

2) If I try to debug using Portable Python 3.2.5.1 from it's install path, I get an exception
ImportError: No module named addons

---
3) If I try to debug using Python 3.4 I get an exception
ImportError: No module named cli

(It seems that the last interpreter gave the best results, as it was able to import addons)

How could I fix this issue?

Kind Regards,

Mario
0

Please sign in to leave a comment.