Instruction to Install Odoo (OpenERP) on Lunix

What is Odoo?

Odoo – Previously known as OpenERP is a powerful, opensource product built in Python and released under the AGPL license, with hundreds of free apps to help in building and customizing our own ERP in very short span of time. It has a very simple and interactive UI that makes it popular among the users. It comes up with many useful and comprehensive apps like CRM, Accounting, E-Commerce, WMS(Warehouse Management System), KMS(Knowledge Management System), IM(Instant Messaging), Purchase, POS, Fleet Management, Payroll, HR, Business Intelligence etc.. and users can choose and install apps as per their requirements to boost their business.Even users can add/edit fields on any page simply by turning on the “Developer Mode” – which makes it easy to customize from front end.

For online demo of Odoo apps, you can sign up here and take a free tour: https://accounts.odoo.com/web/signup

Odoo v8 setup:

Odoo has released its latest stable version i.e., V8 on 18th September 2014 with some new features and bug fixes.

Odoo can be set up in Windows, Ubuntu, CentOS, but for better performance & safety it recommends Ubuntu.

Odoo uses Postgresql database server and switching the Db server involves rewriting the entire ORM – which is a very big task.

Following are the steps to install Odoo v8 on ubuntu 14.04 LTS:

Step:1

Make sure you have freshly installed Ubuntu 14.04 LTS with everything up-to-date

sudo apt-get update && upgrade -y

Step:2

Now let’s install all the necessary Python libraries.

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

Step:3

Create the Odoo user that will run the application

sudo useradd openerp -m -s /bin/bash

Step:4

Install and configure the Postgresql DB server

sudo apt-get install postgresql
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt openerp
Enter password for new role: ********
Enter it again: ********
exit

Step:5

Install the Odoo server. (Install git in case you don’t have it)

sudo apt-get install git

Switch to Openerp user and check out Odoo source repository where you want

sudo mkdir /home/openerp
sudo chown -R openerp:openerp openerp
sudo chmod -R 750 openerp
cd /home/openerp/
sudo su - openerp -s /bin/bash
git clone -b 8.0 https://github.com/odoo/odoo.git

 Step:6

The default configuration file of the server is: /home/openerp/odoo/debian/openerp-server.conf

We’ll copy this config file and put it inside /etc/

sudo cp /home/openerp/odoo/debian/openerp-server.conf /etc/
sudo chown openerp:openerp /etc/openerp-server.conf
sudo chmod 640 /etc/openerp-server.conf

Now we need to edit this config file as shown below:

db_password = False
addons_path = /home/openerp/odoo/addons
logfile = /var/log/openerp-server.log

If you are developing a custom module for openerp and its source code is present in a different location, suppose I’m developing a module named import_export which is present in /var/www/projects/ then, in order to load this module along with the other addons of openerp, we have to include this in the addons list of the above config file as :

addons_path = /home/openerp/odoo/addons, /var/www/projects/

Once the config file is edited and saved, then we can execute the following commands to check the server actually runs.

sudo su openerp -s /bin/bash
/home/openerp/odoo/openerp-server

If we end up with end up with a few lines eventually saying OpenERP is running and waiting for connections then we are all set. Now just hitCTRL+C  stop the server and exit to leave openerp user account.

Step:7

Default ports for Odoo are:

Odoo without IM module(i.e., without psycopg2) : 8069

Odoo with IM module enabled (i.e., with psycopg2) : 8072

Postgresql DB server for Odoo : 5432

Note: IM module is Instant Messaging. To enable this module in Openerp we need to run the server using openerp-gevent which requires the python-psycopg2 library. In this case Openerp server will be run on 8072 port.

But if we don’t want this IM module, then we can run openerp-server instead of openerp-gevent and in that case Openerp server will be run on 8069 port.

We can now run Odoo server in different ways.

1. From supervisorctl:

If you don’t have supervisor process manager, you can install it by:

apt-get install supervisor

Once supervisor is all set, then we need to edit the supervisor.conf file (/etc/supervisor/supervisord.conf) to add Openerp as a  program.

[program:openerp]
command=python /home/openerp/odoo/openerp-gevent -c /etc/openerp-server.conf
numprocs=1
directory=/home/openerp/odoo/
stdout_logfile=/var/log/openerp-server.log
autostart=true
autorestart=true
user=openerp
stopsignal=KILL

If you are developing any custom module and want to keep on updating it each time we restart the server, to reflect your changes, then you need to append -u <your module name> at the end of the command shown above i.e., suppose my module name is import_export then:

command= python /home/openerp/odoo/openerp-gevent -c /etc/openerp-server.conf -u import_export

The -c is followed by the config file of openerp and -u for updating modules.-u all stands for updating all modules

The command line options for Openerp are available here:

https://doc.odoo.com/6.0/developer/1_1_Introduction/4_command_line/

Now once the supervisorconf is set, then we have to update it first to read the changes and restart the server:

sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl restart openerp

Then on the browser we have to type the following url and reload:

If we are using openerp-gevent (which is for IM module) then url will be :[hostname]:8072

For example: localhost:8072

Otherwise if we are running it with openerp-server (without IM module) then it will use port 8069:

For example: localhost:8069

2. As a service:

To run Odoo as service we have to do the following:

sudo cp /home/openerp/odoo/debian/init /etc/init.d/openerp
sudo vim /etc/init.d/openerp

change DAEMON=/usr/bin/openerp-server

to DAEMON=/home/openerp/odoo/openerp-server

save the file and exit

Now put Odoo as a service:

sudo update-rc.d -f openerp start 20 2 3 4 5

And start your Odoo/Openerp service as:

sudo service openerp start

*** Enjoy Openerp V8 ***

Open ERP System (Odoo system)

Recently, I searched an open source ERP software system for our factory use. Luckily, I found an OpenERP software application system (previous name as TinyERP, now name as Odoo). It is programmed by using Python, a very popular programming tools nowadays. After my preliminary test, I had very width functionality with acceptable performance and easy-to-use. It should be a good software application for SME, and I have to study it in-deep. Read More

Select An ERP System in Eight Simple Steps

Introduction
An Enterprise Resource Planning (ERP) system is a series of software applications or modules that collects data from your sales, purchasing, finance, inventory, supply chain, manufacturing and quality functions into a common database so that your company can share the information, coordinate activities and collaborate.

If you’re looking for your first ERP system or looking to upgrade from an existing system, the evaluation, selection and implementation process is a long-term strategic decision for your organization. Read More

IT人在工廠日記 – 談金蝶ERP系統 (2013/04/30)

金蝶K3-ERP系統是一套出名的國內ERP系統,我於香港和國內使用了它兩年,對它的評價是一般,功能太簡單,比不上另一套國內出名的ERP系統 — “用友”,市場流言為 ” 南金蝶、北用友” ;幸好它仍算是穩定和少Bug的系統,間中的數據錯誤是有可能的,但是,最差勁是香港金蝶公司的顧問和技術員,在兩年內,已更換了兩名顧問處理我公司的ERP項目,而且兩名顧問最後也離開了金蝶,另外,負責我公司的銷售員也離開了金蝶公司,人員的流失實在太嚴重了。現時,我發現問題時,會找金蝶的後勤技術員,可是他們水平差,不熟悉我公司的系統設置,問題拖很久仍沒法解決,很令人失望。最後,我忠告各位,暫時請不要選擇使用金蝶,留意它日後會否有改善吧。

香港金蝶K3系统采购申请

  1. 前言

因应工厂之<<ERP系统更新方案>>,经管理层审批後,決定更新現時的金蝶-K3系统。批准的實施计划,分两期進行,第一期是實施会计系統,第二期是全面更新現有的供應鏈和生產系統;而新系统会安装在香港公司,而非在国內厂。因为需要在香港投资于实施金蝶系统之第一期计划,所以編寫此金蝶-K3系统采购建議,供管理層查閱審批。 Read More