install odoo

odoo 10 works on python 2.7

python

python --version

Creating a systemd service

[root@webmail system]# cat /etc/systemd/system/odoo10.service
[Unit] 
Description=Odoo 
After=postgresql.service 
 
[Service] 
Type=simple 
User=odoo 
Group=odoo 
ExecStart=/opt/odoo/odoo-10.0/odoo-bin --addons=/opt/odoo/odoo-10.0/addons/,/opt/odoo/odoo-10.0/reponew,/opt/odoo/odoo-10.0/gst/ -c /etc/odoo/odoo.conf 
 
[Install] 
WantedBy=multi-user.target 

Step 1: 

Update apt source-lists:

Step 2: 

Create the Odoo user that will own and run the application

Step 3: 

Install and configure the database server, PostgreSQL


Once the PostgreSQL is installed, next we setup a new PostgreSQL user for our application. This user will be used for making all the database interaction form the Odoo.


Finally exit from the postgres user account:

Step 4:(Optional)

Your Odoo server may encounter some issue(s), so Im also mentioning few issues & their way around to fix them:

FIX 1: You need to upgrade ”wkhtmltopdf” to 0.12.1  You can also check this LINK


FIX 2: Check if your PostgreSQL have proper encoding(UTF-8) or not, used in Odoo Application, if not you can do like this:


FIX 3: Set The Locale To UTF-8 For Python 3, if you are getting UnicodeEncodeError /UnicodeDecodeError, you can fix it,as: You can also check this LINK

Directly execute these commands:


FIX 4: In postgreSQL, allow TCP connection, if you are getting error like:


To fix it,in /etc/postgresql/9.5/main/pg_hba.conf change peer to md5:


then

Step 5: 

Install the necessary Python libraries & other needed libraries needed for the application:

Odoo 11 will use python 3.5(which is pre-installed on our Ubuntu), previously it uses python 2.7, so in order to install all dependent libraries easily well install pip3 in our server, as:


Once pip3 is installed on your server, we can proceed with installing other dependent libraries using pip3 as:


Next is to install Odoo Web Dependencies:


Once all the packages are installed we are ready to proceed with installing Odoo server.

Step 6:

Installing ODOO version 11 Community Edition hosted on GITHUB.

Make sure you have GIT installed on your system and if not then install with the simple command:


Switch to the Odoo user:


Clone the latest branch of Odoo, in our case it is 11.0 from Github:


(This might take a little while depending on the speed of your Internet connection.)

Finally exit from the odoo user account:

Step 7:

Next step is to create a configuration file for Odoo. But before doing so wll first create the directory for storing logs of Odoo server and assigning proper ownership to the directory:


Next is to create the configuration file for odoo server. Odoo application will use these configuration to run so fill in the configuration as per your requirements.


A sample configuration file will look like this:


[root@webmail odoo]# cat /etc/odoo/odoo.conf 

[options]

; This is the password that allows database operations:

; admin_passwd = admin

db_host = False

db_port = False

db_user = odoo

db_password = admin

addons_path = /usr/lib/python2.7/site-packages/odoo/addons



(* You need to use the same password you used back in step 3.)

Once the configuration file is created we will set the ownership rights

Step 8:

Installing the boot script

For the final step we need to install a script which will be used to start-up & shut-down the Odoo server automatically, with the correct user. Here is a Link, you can use this script for the same purpose, as:


Paste the same contents of this script to this file. Once it is in the right place you will need to make it executable and owned by root:


Step 9:

Testing the server

To start the Odoo server type:


You should now be able to view the log-file as:


If there are any problems in this step you need to go back and check, feel free to comment on this blog ill try my best to help you :)

[OPTIONAL] Also, in order to debug, you can start the server manually just to check if it actually runs well or not, as:

sudo su - odoo -s /bin/bash

/opt/odoo/odoo-bin

If the log file looks OK, you can check Odoo server running on your browser with url:


BOOT SCRIPT USAGE:

Comments

Post a Comment

Popular posts from this blog

cpanel exam CPSP Answers

How to install zimbra collaboration suite 8.8.11 on CentOS 7

awstats installation