This post helps to setup OpenERP 7.0 Development Environment in Ubuntu.
For this development, I am using “ubuntu-12.04.1-desktop-amd64”. I have divided the steps in the following categories
- Install Python
- Install required tools for python
- Install Aptana Studio
- Download OpenERP Source Code from bzr
- Configure and Install Postgres
- Configure OpenERP in Aptana Studio and Run
Step 1: Here is the command to install python
sudo apt-get install python
Install required tools for python
Step 2: Here is the command to Required tools for OpenERP
sudo apt-get install python-dateutil python-docutils python-feedparser python-gdata python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-psycopg2 python-psutil python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi
The above command installs all the tools except gdata. Here is the command to install.
sudo apt-get install python-pip
sudo pip install gdata --upgrade
Install Aptana Studio
Step 3: Please download the aptana studio from the website
The Aptana Studio files are in zip format. If you do not have the zip installed. Here is the command to do that.
sudo apt-get install zip unzip
The following is the command to unzip the downloaded aptana file.
sudo unzip Aptana_Studio_3_Setup_Linux_x86_64_3.4.2.zip
To create a desktop shortcut, please follow the command otherwise you can move to next step
3.1 Change the name of the Aptana Folder
sudo mv Aptana_Studio_3_Setup_Linux_x86_64_3.4.2 aptana
3.2 Move Aptana to opt folder
sudo mv "aptana" /opt
3.3 Create Softlink
sudo ln -s "/opt/apata/AptanaStudio3" /usr/bin/aptana
3.4 Create Desktop Shortcut
Use vi or other to create a file. The command is
sudo vi /usr/share/applications/aptana.desktop
The contents of the file are
Download OpenERP Source Code from bzr
Step 4: Here are the following command to install Bazar and download OpenERP code
sudo ap-get install bzr
sudo bzr branch http://launchpad.net/openobject-addons/7.0 addons
sudo bzr branch http://launchpad.net/openobject-server/7.0 server
sudo bzr branch http://launchpad.net/openerp-web/7.0 web
Configure and Install Postgres
Step 5: Command to install Postgres
Install the Postgres
sudo apt-get install postgresql postgresql-contrib
The next two steps is mainly useful if you want to manage the postgres remotely. For instance, if you want to take the daily backup of your postgres db from your system or you want to issue any SQL Statements remotely.
Step 3: We need to tell Postgres that we will use the password to connect to the DB from any IP address to access it.
Open the file in vi editor.
sudo vi /etc/postgresql/9.1/main/pg_hba.conf
Look for # IPv4 local connections in the above file. Replace the line with the below one
host all all 0.0.0.0/0 password
Step 4: This step asks the Postgres to accept connection from any address
Open the file vi editor
sudo vi /etc/postgresql/9.1/main/postgresql.conf
Look for listen_address=’localhost’ and replace with
listen_addresses = '*'
At the time of writing, it was in 59th line.
That’s it. Postgres installed successfully. To Start the service, use the following command
sudo service postgresql start
Step 5: In order to connect to the Postgres remotely. we need to change the DB username. This step will do that.
Change the postgres user password
sudo passwd postgres
Change SU to postgres
Login to PSQL to Change the postgres password
ALTER USER postgres WITH PASSWORD 'abcABC';
q is the command to exit
Install the PgAdmin
sudo apt-get install pgadmin3
Configure OpenERP in Aptana Studio and Run
Step 6: Lets create the local branch using Bazar for the development. Here are the commands.
Please make sure branches are created in the Aptana workspaces.
Here are the commands to create the local branch
sudo bzr branch /home/hasan/openerp/addons addons
sudo bzr branch /home/hasan/openerp/server server
sudo bzr branch /home/hasan/openerp/web web
Step 7: Open up Aptana and import the projects.
Here are the steps
Step 7a: Create a PyDev Project and click next
Step 7b: In the next screen, please give the project name as “addons” and uncheck the use default in the project contents and choose the directory where you have created the branch
Step 7c: Follow the steps 7a, 7b for other projects web and server
Step 8: Change the Parameter for Server Startup
Create the file called openerp-server.conf in the Server Project and contents of the file are
; This is the password that allows database operations:
; admin_passwd = admin
db_host = localhost
db_port = 5432
db_user = openerp
db_password = ahghbfgfc
addons_path = ../web/addons,../addons
log_level = info
xmlrpc_port = 7069
Please make sure you have changed the content according to your requirement.
Step 9: Rename the file openerp-server in the server project to openerp-server.py
Step 10: Start the OpenERP
Create the Run Configuration like one be
and add the config file to the program arguments and run the file
Share your feedback if any.