DEV Community

Cover image for (Odoo Series) - #1. Simple Odoo Development on Ubuntu Desktop
Galuh Ibrahim
Galuh Ibrahim

Posted on

(Odoo Series) - #1. Simple Odoo Development on Ubuntu Desktop

Greetings Dev.to community!

Odoo, previously known as OpenERP, has become one of the most popular Enterprise Resource Planning (ERP) systems in the world. With more than 7 million global users, Odoo offers comprehensive and flexible integrated business solutions for organizations of all types and sizes.

Odoo is an open source ERP platform developed by Odoo S.A., a Belgium-based company. Since its launch in 2005, Odoo has evolved from a simple business management system to a complete suite of business applications, covering various aspects of a company's operations.

Here is my journey related to Odoo development in several applications that I am developing in my current company, I want this to be a useful odoo series for all of you.

  • You should make sure to update the Linux library you are using

    sudo apt update
    
  • Install PostgreSQL Database, for how to install it, you can see the documentation here

  • Create an Odoo User for Postgres

sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt (change to your username)
exit
Enter fullscreen mode Exit fullscreen mode

Then open pg_hba.conf file with this command below.

sudo gedit /etc/postgresql/(change with your postgresql version)/main/pg_hba.conf
Enter fullscreen mode Exit fullscreen mode

After that, change the words peer to md5 on lines 90, 95, and 102, as shown below.
FROM THIS

Image description
TO THIS

Image description

after that restart your PostgreSQL.

sudo service postgresql restart
Enter fullscreen mode Exit fullscreen mode
  • Download Source Odoo Community v16
wget https://nightly.odoo.com/16.0/nightly/src/odoo_16.0.latest.tar.gz
Enter fullscreen mode Exit fullscreen mode
  • Define the Odoo Source & Addons Path

A. Create a Projects folder on the ubuntu desktop

Image description

B. Move the Odoo folder into the Projects folder, you will see the structure of our Odoo platform.

Image description
C. Create a folder called conf and create an odoo.conf file in it, then fill it with the following scipt.

Image description
D. Copy the odoo file in the setup folder, then move it to the root project, then change the file name to odoo-server.

Image description

  • Install Odoo Library
sudo apt install -y git wget nodejs npm python3-pip python3-polib build-essential python3-dev python3-venv python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libldap2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev python3-gevent

sudo npm install -g rtlcss
Enter fullscreen mode Exit fullscreen mode
  • Install WKHTMLTOPDF Library
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb

sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb 

sudo apt install xfonts-75dpi

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb

sudo dpkg -i wkhtmltox_0.12.6-1.focal_amd64.deb 
Enter fullscreen mode Exit fullscreen mode
  • Create Odoo Environment Create a virtual environment for our odoo application, this is done to isolate the libraries we use when developing odoo modules using this command.
python3 -m venv env
Enter fullscreen mode Exit fullscreen mode

After that, you can install all requirements library for your odoo using this.

source env/bin/activate

pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

Image description

  • Run Odoo Service
python3 odoo-server -c conf/odoo.conf
Enter fullscreen mode Exit fullscreen mode

Top comments (0)