Odoo development Ubuntu using Eclipse.


In this blog we will go through the steps required or OpenERP V6.1 Customization under the eclipse editor in Ubuntu 11.10.
Run the following commands in from the terminal.
First of all you must have to run all the commands as super user so all the commands must be run as "sudo <commnad>"
Install eclipse & its dependencies.
sudo apt-get update
sudo apt-get install eclipse
2. Install python and its libraries packages required for openerp-server
sudo apt-get install python python-psycopg2 python-reportlab  python-pychart python-pydot python-egenix-mxdatetime python-lxml python-libxslt1 python-tz python-dateutil python-vobject python-mako python-yaml python-dev python-setuptools python-pybabel
3.  OpenERP server uses Postgresql database server for its backend so we need to install it.
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.1 postgresql-client-9.1 
postgresql-  contrib-9.1
4. Create a database user for OpenERP in Postgresql server, who can create  databases and manipulate them.
sudo su postgres
createuser <system-user-name> (enter "y" for super user role)
exit
5. To allow postgres database to be accessed by anywhere in pgadmin3 we need to do following steps.
-- edit /etc/postgresql/9.1/main/postgresql.conf and change the following properties.
 uncomment the listen_addresses property and set it to,
listen_addresses = "*"
-- edit  /etc/postgresql/9.1/main/pg_hba.conf and do as follows,






Replace following portion ,
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
with,
# IPv4 local connections:
host    all             all             0.0.0.0/0            md5 
( This will allow all IP's to connect with your postgresql server.)
6.   Openerp-server V6.1 requires Werkzeug and Python-openid packages to be installed.
     wget http://pypi.python.org/packages/source/W/Werkzeug/                           
    tar -zxvf  Werkzeug-0.8.3.tar.gz
     cd Werkzeug-0.8.3      
     python setup.py install                   
     wget http://pypi.python.org/packages/source/p/python-openid/    
     tar -zxvf python-openid/python-openid-2.2.5.tar.gz
     cd python-openid-2.2.5
     python setup.py install
7.   Install PyDev plugin in eclipse
       6.1)help -> Install New Software.
       6.2)In Install dialog box, Click Add.
       6.3)Give name ‘pydev’ and type the path. i.e.
       6.4)click ok.
       6.5)select pydev checkbox and follow the steps by clicking finish.


8.     Adding python in eclipse can be done by


      7.1)window -> Preferences
       7.2)In Preferences dialog box expand pydev from left side tree
       7.3)click on Interpreter-Python
       7.4)click new (python interpreter)
       7.5)browse and select  "File System-->usr-->bin-->python" and  also give name "python2.7"
       7.6) click ok then again ok
9.   Download Openerp 6.1 source tarball from,
     http://nightly.openerp.com/6.1/releases/openerp-6.1-1.tar.gz


10.   Extract the tarball downloaded and create a folder Openerp and move the tarball and extract it there, rename it to Openerp-6.1
11.  Switch the workspace folder to created Openerp folder and create a new Pydev project in eclipse named Openerp-6.1.
         New-> project --> Pydev --> Pydev project
         project name - Openerp-6.1
         check Use default
         Press F5 after creating the project to refresh the workspace. 
12.   In Eclipse package explorer, Rename openerp-server in Openerp-6.1 folder to openerp-server.py.
        Right Click on,  openerp-server.py --> Run as --> Python run. 
Notes:  
In version 6.1, When server gets started, then it will automatically start the OpenERP Web also.  We don't have to start the OpenERP Web manually. 
The Default port the server starts on is 8069, but if you want to change that port then you can change it from the config.py file.  

How to install Odoo on Ubuntu


Step 1 – Installation of Ubuntu

Ubuntu can be installed in any server through the setup files. Latest Ubuntu version can be installed from http://www.ubuntu.com/download/ubuntu/download. Please take care to check your system whether you have to download 32 or 64 bit OS. If you are going to use Ubuntu as default OS, then you can continue installation after the file downloads.
After the Ubuntu OS is installed, run the update manager to download and install all the latest updates. This step will be deemed finished only when you have installed Ubuntu and updated it as well. If you’re finished, move to the next step.
Important: While installation, you will be asked to enter name, username and a password. Choose the following for simplicity. This manual is written with the same credentials
Name – XXXXXXXXX
Username – openerp
Password -openerp
 
Step 2 – Installation of Python Packages and Postgresql Database
This step installs all the python packages and Postgresql database required to run OpenERP. Open the terminal window found in applications. You will see the following command prompt:
openerp@ubuntu:~$
At this command prompt copy and paste the command shown below and press enter.
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 postgresql
sudo apt-get install python-pip
sudo pip install gdata --upgrade
This command will download, unpack and install the required python libraries and postgresql database in the system. It will take some time to complete and at the completion you will again the see the command prompt as shown above.
Note: In between the installation, you make be asked the password which is “openerp” as given in the 1st step and you may also be asked if you want to continue. You will have to press “y” to continue.
This step will be deemed finished when all the libraries and database are installed successfully and you are at command prompt again.

Step 3 – Setup a PostgreSQL user for OpenERP

The default superuser for PostgreSQL is called postgres. You may need to login as this user first.
openerp@ubuntu:/$ sudo su postgres
password: XXXXXXXXXX
 
Now create PostgreSQL user openerp using the following command:
postgres@ubuntu:/home/openerp$ createuser openerp 
Shall the new role be a superuser? (y/n) y
This step will be deemed finished when user “openerp” has been created and you are at command prompt again.
Step 4 – OpenERP Installation
Download the latest version of OpenERP from http://nightly.openerp.com/7.0/nightly/src/openerp-7.0-latest.tar.gz/. Extract the downloaded openerp setup and put the extracted folder in Home (openerp in this case).
Open the terminal window found in applications. Start the installation by typing following commands -
openerp@ubuntu:~$ cd openerp-7.0
openerp@ubuntu:~/openerp-7.0$ sudo python setup.py install
This step installs the OpenERP in your system including server and the client. It will take some time to complete and at the completion you will again the see the command prompt again.
This step will be deemed finished when user “openerp” has been created and you are at command prompt again.

Step 5 – Starting OpenERP Server with autoscript

Open the startup services of Ubuntu and add a new service. Enter the following information
Name – OpenERP
Command – /home/openerp/openerp/openerp-7.0/openerp-server
Save the same and close the startup services and then restart the computer.
This step will be deemed finished when the system has been restarted.

Step 7 – Using OpenERP

Open the browser and type the following address http://localhost:8069/


Odoo First Steps


http://www.glom.org/wiki/index.php?title=Initial_Postgres_Configuration
Welcome to OpenERP & Python Module Developing Blog.......
http://mirnauman.wordpress.com/2010/09/02/openerp-module-development-part-1/
sudo su – postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt openerp
Enter password for new role: ********
Enter it again: ********

SAMBA Install
When ever u make a change to the code, and u think ur code is perfect and fine in every aspect, u have to restart the server.
open the terminal and type
sudo /etc/init.d/openerp-server restart
http://nicechirag.blogspot.com/2012/01/openerp-complete-guide-for-module.html
http://mohsinpage.wordpress.com/category/openerp/

---------------------------Develop using eclipse-----------------------------
http://apagen.wordpress.com/2012/11/30/how-to-setup-openerp-development-environment-using-eclipse-in-ubuntu/
http://www.zbeanztech.com/blog/openerp-61-development-environment-ubuntu-using-eclipse
http://update-production-pydev.s3.amazonaws.com/pydev/updates/site.xml