Monday, 17 August 2015

Odoo Installation !


Do you Want to use Odoo on your own premise ? If yes then this blog is meant for you.


Let see how we can install Odoo 8.0 on our own premise. 
 
There are mainly 3 components 
 1: Odoo server 
 2: Odoo Client 
 3: Postgres Database.

Odoo had two clients GTK (Thick Client Desktop) and Web Client. 
As of now the GTK client is no more used nor maintained. 
All latest Odoo applications is recommended to access via web client.

As of latest Odoo Version the web client is now embedded in the main 
Odoo Server and it does not require to be deployed separately.

Now, let's see the installation procedure for linux distribution
we wil first need to install PostgreSQL, the database engine used by Odoo, 
then we will install Odoo itself.

Installation of PostgreSQL
 
We use the following command on command prompt to install the postgresql package:
 sudo apt-get install postgresql
 For example:
 Odoo@cozybizs-desktop:/$ sudo apt-get install postgresql

Then next we will also install the a graphical user interface of postgresql,for this we will use the 
following command:
 sudo apt-get install pgadmin3
 For example:
 Odoo@cozybizs-desktop:/$ sudo apt-get install pgadmin3

after we finished the instaltion we will need to create a postgreSQL user, This user needs to be same as our
system user because odoo will use this user to connect to the database. If we do not create this user then
we want be able to create a database from the Odoo Client.

There are two methods to create this user:

Method 1: 
We may first need to login as default superuser of postgreSQL called as postgres.

          Odoo@cozybizs-desktop:/$ sudo su postgres

Now we create a PostgreSQL user odoo by following command:
postgres@cozybizs-desktop:/$ createuser odoo
Shall the new role be a superuser? (y/n) y

we will need to make this new user a superuser,as this user is the owner of all the tables 
created by Odoo Client.Next, connect to the default table template1
using the command as:
postgres@cozybizs-desktop:/$ psql template1

now we need assign  access rights to the role odoo for the database which will be created 
from Odoo Client, for this use the command as under

template1=# alter role odoo with password 'postgres';

Method 2:
 
postgres@cozy-desktop:/$ createuser --createdb --username postgres –no-createrole --pwprompt odoo
Enter password for new role: ********
Enter it again: *********
Shall the new role be a superuser? (y/n) y
CREATE ROLE

Installation of Odoo Server
 
First we will need to get all packages installed. Use the following command to install 
all required packages in one shot.
 
sudo apt-get install python-dateutil
python-decorator python-docutils python-feedparser \
python-gdata python-gevent python-imaging
python-jinja2 python-ldap python-libxslt1 python-lxml python-mako
python-mock python-openid python-passlib python-psutil
python-psycopg2 python-pybabel python-pychart python-pydot
python-pyparsing python-pypdf python-reportlab python-requests
python-simplejson python-tz python-unittest2 python-vatnumber
python-vobject python-werkzeug python-xlwt python-yaml wkhtmltopdf

Note: The wkhtmltopdf has version issue with Ubuntu 14.04. To fix this follow the below steps:
sudo wget http://jaist.dl.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin

Update:If still you face erros while printing Qweb reports then just go to menu 
Settings/Technical/ System Parameters just create a new entry with:
Key:webkit_path
Value:/usr/bin/wkhtmltopdf ( This is the path of the binary installed on your system)

Next install Git to fetch Odoo latest source code.
sudo apt-get install git git clone https://www.github.com/odoo/odoo
--depth 1 --branch 8.0 –single-branch
 
now we have the latest source of Odoo.  Open the terminal and just go to the path where source 
is installed. 
For example cd /home/cozybizs/odoo/8.0 and you will have this.
odoo@cozybizs:~/workspace/odoo/8.0$
 
now start odoo server as under:
odoo@cozybizs:~/workspace/odoo/8.0$ ./openerp-server --addons-path=addons
Alternatively you can also specify the parameters on command line or edit the configuration file usually
saved with name and path as $HOME/.openerp_serverrc.You can also You can start the OpenERP 
server with the -s option to create a configuration file with default options.
You can download different packages like .exe,rpm, deb  from https://nightly.odoo.com/

For more details and having your own VPS setup and hosted contact us. Or drop an email at info@cozybizs.com