Who we are

About IT Horizon

A boutique technology house engineering enterprise systems with the precision of a luxury maison.

Our story
Odoo Partner

Comprehensive Odoo

End-to-end Odoo 20 Enterprise, implemented, customized, integrated and supported by our own senior team.

Become a client
Odoo apps

Every app, configured for the Gulf

Finance, sales, supply chain, HR, marketing and services apps implemented with the local tax, payroll and language rules each country needs.

All Odoo apps
What we do

Beyond ERP

Strategy, product engineering and customer-experience work that turns systems into advantage.

Talk to us
Sectors

Industry depth

Domain fluency across the sectors that define the GCC economy, and the regulations behind them.

Discuss your sector
Learn · grow · succeed

Insights

Real-world ideas, case studies and sessions to help your business work smarter with Odoo.

Browse the blog
Contact usالعربيةBook a consultation
Home/Blog/Odoo 20 · Developer guide
Odoo 20 · Developer guide · 8 min read

How to set up an Odoo 20 development environment with PyCharm on Ubuntu

Ubuntu is the natural home for Odoo development because it matches the servers Odoo runs on in production. This guide sets up Odoo 20 on Ubuntu 24.04 LTS with PyCharm, a virtual environment and PDF reports that print correctly.

What changed since Odoo 19

  • Python 3.12 or newer. Odoo 20 will not start on anything older, and warns on versions newer than 3.14. Odoo 19 accepted 3.10.
  • PostgreSQL 16 or newer. Odoo 20 warns when it connects to an older server; Odoo 19 asked for 13.
  • A choice of PDF engine. wkhtmltopdf is still the default, and Odoo 20 adds an optional engine of its own, Paper Muncher.
  • Access rights in one file. Modules declare access in security/ir.access.csv, one line per group and set of operations with an optional domain, which replaces both ir.model.access.csv and record rules.

Why Ubuntu 24.04

Ubuntu 24.04 LTS ships Python 3.12 and PostgreSQL 16, the minimums for Odoo 20, and Odoo pins its Python dependencies to the versions that release packages. On Ubuntu 22.04 you would need Python 3.12 from the deadsnakes PPA and PostgreSQL 16 from the PostgreSQL apt repository.

Step 1: install PyCharm

sudo apt update && sudo apt upgrade -y
sudo snap install pycharm --classic

PyCharm is now one product with a free tier: after the 30-day Pro trial, the free core features are enough for Odoo work.

Step 2: install Python and the build libraries

sudo apt install -y python3 python3-dev python3-venv build-essential \
  libpq-dev libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev \
  libjpeg-dev libldap2-dev libsasl2-dev

These let pip build the packages that have no ready-made wheel on Linux, such as python-ldap and psycopg2.

Step 3: install Node.js and rtlcss

Odoo compiles its own styles, but right-to-left languages such as Arabic need the rtlcss tool:

sudo apt install -y nodejs npm
sudo npm install -g rtlcss

Step 4: install wkhtmltopdf for PDF reports

wkhtmltopdf is still Odoo 20’s default PDF engine. Use the patched Qt build 0.12.6.1, otherwise headers, footers and page breaks print incorrectly. The Ubuntu 22.04 (jammy) package installs on 24.04:

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb
sudo apt install -y ./wkhtmltox_0.12.6.1-3.jammy_amd64.deb

Odoo 20 also offers an engine of its own, Paper Muncher, in the optional module base_report_paper_muncher. It needs the paper-muncher program, version 0.6 or later. wkhtmltopdf stays the default unless you switch.

Step 5: install PostgreSQL and create the Odoo user

sudo apt install -y postgresql postgresql-client
sudo -u postgres createuser --createdb --no-createrole --no-superuser --pwprompt odoo20

On your own machine you can make the role a superuser to avoid permission errors when restoring databases. Never do this on a server. Odoo refuses to run as the postgres user itself, which is why it gets a role of its own.

sudo -u postgres psql -c "ALTER USER odoo20 WITH SUPERUSER;"

Step 6: get the Odoo 20 source

sudo apt install -y git
git clone https://github.com/odoo/odoo.git --branch 20.0 --depth 1 odoo20

With an Odoo Enterprise subscription, clone the 20.0 branch of the enterprise repository next to it.

Step 7: create a virtual environment and install the requirements

Open the odoo20 folder in PyCharm and run in its terminal:

python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

If psycopg2 fails to build, check that libpq-dev and python3-dev from Step 2 are installed, or install psycopg2-binary instead.

Step 8: write odoo.conf

[options]
; master password for the database manager
admin_passwd = change-me
db_host = localhost
db_port = 5432
db_user = odoo20
db_password = your_password
addons_path = /home/you/odoo20/addons
http_port = 8069

With Enterprise, list its folder first: addons_path = /home/you/enterprise,/home/you/odoo20/addons. Leave logfile out while you develop, so the log shows in PyCharm’s console.

Step 9: add a run configuration

Run → Edit Configurations → + → Python:

  • Script path: odoo-bin
  • Parameters: -c odoo.conf
  • Working directory: the odoo20 folder
  • Interpreter: the venv you created

Click Run or Debug, then open http://localhost:8069. The database manager confirms the environment works.

Tips from our developers

  • Keep your own modules in a separate folder and add it to addons_path; never edit Odoo’s core addons.
  • Use Git from the first line of code, one repository per client or product line.
  • Start Odoo with --dev=all while you work; with inotify or watchdog installed in the virtual environment, Python changes reload without a restart.
  • Run a module’s tests on a throwaway database with -d test20 -i your_module --test-enable; Odoo stops when they finish.
  • Declare access in security/ir.access.csv: a line per group and set of operations, with a domain where you would have written a record rule before.

Building modules for a client and short of hands? Hire an Odoo developer from our team in Kuwait.

Need help with your Odoo project?

Tell us what you are working on. A senior consultant will reply with how we would approach it.