How to install Eclipse on Windows
- Download and install the Java SE JDK
- Download and install Eclipse Classic 3.5.1 or later from http://eclipse.org
- In Eclipse, install PyDev by going to Help / Install new software / Add.
- Name: Pydev
- Location: pydev.org/updates.
- Then tick PyDev, Next, Install PyDev for Eclipse.
- After it has installed, go to Windows / Preference / Pydev / Interpreter – Python; go to Python Interpreters.
- Click the “Auto Config” button. It should list a lot of directories. Make sure you tick the directory for PyDev; it is probably the first or last directory in the list, and probably the only one not yet ticked.
How to install Eclipse on Centos 5.5
These instructions are for Centos 5.5.
How to setup up Ecplise for debugging on Linux
If you are logged into a graphical desktop, you can debug OpenERP using the following procedure:
- Copy ~openerp/.openerp_serverrc to your home directory.
- Edit /<your-home-directory>/.openerp_serverrc; change the entries for root_path and addons_path as appropriate, e.g.:
- root_path = /<your-home-directory>/eclipse.workspace/OpenERP/src
- addons_path = /<your-home-directory>/eclipse.workspace/OpenERP/src/addons
- Create a new project in Eclipse.
- Copy all the OpenERP source into the src directory of the project, including all the sub-directories.
- It is easier if you start Eclipse in the directory where your project lives. There may be a better way to do this, but you could:
How to run Eclipse on Linux in a window on Windows using X-Windows
To turn your Linux’s installation of Eclipse from your Windows PC, download and install the XMing server. This actually works quite well – the responsiveness is better than running a Gnome desktop inside a Virtual Machine. Run Xlaunch and tell it to run eclipse or your start_eclipse shell script in a multi-window environment.
Download and install code snippets from: http://code.google.com/p/openerp-eclipse-template/
Code snippets are shortcuts for adding template code.
If you create a file in Eclipse, the Windows version, and it saves in DOS format (as opposed to Unix format end-of-lines), then OpenERP 5 will not detect or load the module. You can use Unix’s file command to tell you which files have these unwanted CRLF’s:
E.g. these files had problems (note the CRLF line terminators notes):
/home/phil/openerp/addons/my_product_kit # file *.py *.xml
__init__.py: ASCII Java program text, with CRLF line terminators
my_product_kit.py: ASCII Java program text, with CRLF line terminators
but these did not:
/home/phil/openerp/addons/my_product_kit # file works/*
works/__init__.py: ASCII English text
works/my_territory.py: ASCII Java program text
works/my_territory.xml: ASCII text
works/__terp__.py: ASCII text
IDE’s that you can use for Python
Here’s a list of IDE’s that you can use for Python:
- Eclipse on Windows
- Eclipse on Linux
- Aptana – based on Eclipse
- Visual Studio 2010 with IronPython
Python Code Editors
Here’s a list of editors for Python code:
How to set up Samba
How to set up Samba on Centos 5 so you can share a drive from a Linux box to a Windows PC. This is so that you can run Eclipse on your PC to edit files on your Linux OpenERP server.
# service smb start
# smbpasswd -a philu
# setsebool -P samba_enable_home_dirs
# setsebool -P samba_export_all_rw on
# chcon -R -t samba_share_t /home/philu
Then mapped a network drive from Windows, using:
- User: \username
- Share: \\openerp.example.com\username
Use your IDE’s tools, or the Python debugger: http://docs.python.org/library/pdb.html