how to setup eclipse for coding openerp

Asked by Akshay Jain on 2010-03-19

how can i setup the eclipse ide for coding modules for openerp? Following is my system config:

OS: Windows XP SP3
IDE: Eclipse with Pydev
OpenERP: 5.0.7
Bazaar: 1.0

Is there any step by step guide/resources on how to get eclipse ready for openerp coding on WINDOWS?

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
OpenERP Committers Edit question
Last query:
2010-03-20
Last reply:
2010-03-30
t.o (emailbox4oerp) said : #1

Hello,

see http://openobject.com/forum/topic15140.html?highlight=eclipse

(french forum)

Objectives:
Using Eclipse (development platform) to create their own modules and test them for OpenERP.
The principle is simple, you must run the server openerp from eclipse, so it allows you to debug your sources.

Background:
I found many posts on the subject, but none gave any information necessary and only by crossing all the information that I did it. Therefore, you will find below the compilation settings made.
Thank you to past and future contributors to improve the completeness of this message (Oscar Agreda, cedo, Lars Vogel, kantnfahrer, ...)

Prerequisite:
OpenERP v5.0.6
Eclipse SDK 3.5.1
For info installation was done under Windows XP, which certainly complicates things ...

Detail:

1 - First of all facilities

openerp facility you will find many posts on the subject Wink to download: http://openerp.com/downloads.html
Installing the JDK 6 Update 18: http://java.sun.com/javase/downloads/widget/jdk6.jsp
Eclipse Classic 3.5.1: http://www.eclipse.org/downloads/

conventional system and rather simple to do, you can find a well done video on the subject: http://blip.tv/file/3093220

2 - Installing python2.5 and all libraries needed to run pyhon OpenERP

the list is as follows:

nsis-2.40-setup.exe
graphviz-2.20.2.exe
python-2.5.2.msi
egenix-mx-base-3.1.1.win32-py2.5.msi
egenix-pyopenssl-0.8.0_0.9.8i_1.win32-py2.5.msi
PyXML-0.8.4.win32-py2.5.exe
libxml2-python-2.7.1.win32-py2.5.exe
lxml-2.1.2.win32-py2.5.exe
matplotlib-0.98.3.win32-py2.5.exe
numpy-1.2.1-win32-SuperPack-python2.5.exe
IL-1.1.6.win32-py2.5.exe
Pychart-1.39.win32.exe (created by Stephane Wirtel)
ReportLab-2.2.win32-py2.5.exe
vobject-0.7.1.win32.exe (created by Stephane Wirtel)
pygobject-2.14.1-1.win32-py2.5.exe
pygtk-2.12.1-2.win32-py2.5.exe
pycairo-1.4.12-1.win32-py2.5.exe
install by default (in C: \ GTK with options by default)
gtk-2.12.9-win32-2.exe
install by default (in C: \ GTK with options by default)
gtk-dev-2.12.9-win32-2.exe
pydot-1.0.2.win32.exe (created by Stephane Wirtel)
pyparsing-1.5.0.win32.exe
pywin32-212.win32-py2.5.exe
py2exe-0.6.8.win32-py2.5.exe
hippo-canvas-0.3.0-win32.zip
psycopg2-2.0.8.win32-py2.5-pg8.3.4-release.exe
setuptools-0.6c9.win32-py2.5.exe

you can find them here: ~ http://bazaar.launchpad.net/ openerp / openerp / win-installer-trunk / files / head% 3A/dependencies /

Tip: You can not install all the library and wait for Eclipse prompts you to install a particular component.

3 - Setting up eclipse with pydev

Launch Eclipse
Help Make / Install New Software
To Add (name = Pydev; url = http://pydev.org/updates)
Select: Pydev

Make Window / Preferences
Select Pydev / Interpreter-Python
Add new and select the installation directory of your Python 2.5 and update.

4 - Preparing the ground to create your project in eclipse

Have your server a directory with all sources OpenERP (for download: http://openerp.com/downloads.html) eg C: \ OpenERP \

Add to the root directory of the configuration file: openerp-server.conf
change the following items (logfile, pg_path, root_path, addons_path) for this to be consistent with your environment
also modify the following parameter: debug_mode = true

5 - Create the project in Eclipse

In Eclipse
Make File / New / Pydev Project
Give the name you want
Uncheck the box: use default
Select the directory that you created in the previous step (eg C: \ OpenERP \)
Choose: Project Type = Python Grammar version2.5, and the interpreter that you set in the third stage.

6 - Making the connection to the debug

In Eclipse
Make Run / Debug Settings ...
In the left list choose PythonRun and right-click New
Give a name of your choice
In the Main tab: Project = your new project, Main module = $ (workspace_loc: OpenERP / openerp-server.py)

Then you can start the debug mode in the control window you need: pydev debugger: starting
Otherwise you are missing a library, and add restart, until the message.
The execution trace is visible in the file log = server.log-openerp

Then start a client OpenERP and it's up to you

To set a breakpoint in a python file: choose a file from the list on the left view and right click to add a breakpoint.

To go further:

Tuning ecliptic for xml:
In Eclipse
Help Make / Install New Software
Select: Galileo - http://download.eclipse.org/releases/galileo
Then: Web, XML and Java EE development

Integration of templates openerp:
to assist you in developing your modules

The necessary files:
templates-openerp.xml
Openerp-eclipse-xml-template.xml
http://code.google.com/p/openerp-eclipse-template/

you have a video to explain here:
http://www.youtube.com/watch?v=kfMk31VKxrY
and the second here http://www.youtube.com/watch?v=LCxYpofncKs

Akshay Jain (akshay-jain-7983) said : #2

Hi Oli,

I cannot find any openerp-server.py file in my openerp installation and neither could find it in bazaar. Where can i get this file?

Akshay Jain (akshay-jain-7983) said : #3

Oli,

On windows openerp is started as a windows service and not by invoking openerp-server.py. How can eclipse debug in such a case? Are you sure the windows installers on http://openerp.com/downloads.html have this openerp-server.py file?

Oli (oli) said : #4

Whoever just assigned the bug to me, please revert that.

I am not the same Oli that posted the first reply... That was ~cpvoso. I am ~oli

Akshay Jain (akshay-jain-7983) said : #5

Ok guys I have got it working by getting sever lp:openobject-server/5.0 from and dependencies from lp:~openerp/openerp/win-installer-trunk

But the server installation from http://openerp.com/downloads.html DOES NOT have any openerp-server.py file. It would be good if it has this file in future releases but for now anyone wanting to set up openerp in eclipse on windows should get server from lp:openobject-server/5.0

It works correctly but there is one big trouble i.e. when i launch server from eclipse then i am not able to create a new database BUT when i launch the server from Windows service then i can easily create database. So dont know why i cannot create a new database when server is launched from eclipse??

We have got a free course on www.aulaerp.com to set up openerp-eclipse

Anybody can register and try the course. Sorry, It's written in spanish.
Maybe google translator could help you.

2010/3/30 vra (openerp) <email address hidden>

> Question #104901 on OpenObject Addons changed:
> https://answers.launchpad.net/openobject-addons/+question/104901
>
> Assignee: None => OpenERP Commiters
>
> --
> You received this question notification because you are the assignee for
> this question.
>

--
Ana Juaristi Olalde
Consultor Freelance OpenERP
www.anajuaristi.com
www.openerpsite.com
www.avanzosc.com
677 93 42 59 - 943 85 06 25

Can you help with this problem?

Provide an answer of your own, or ask Akshay Jain for more information if necessary.

To post a message you must log in.