how-to-set-up-odoo-17-development-environment-using-pycharm-on-ubuntu-22-04

How to Set Up Odoo 17 Development Environment Using Pycharm on Ubuntu 22.04

Odoo’s latest update, Version 17, is renowned for its extensive features, complementing the software’s capabilities in efficient business management.
In this version, backend development utilises Python 3.10 or higher, while PostgreSQL serves as the database server, and JavaScript supports the frontend development.

PyCharm on Ubuntu 22.04, a Long-Term Support (LTS) release, ensures continuous application updates and vital security patches for five years following its initial release. It also introduces new versions of the Linux kernel and enhancements to graphics drivers through regular software updates, typically issued every six months. Notably, Ubuntu 22.04 comes pre-installed with Python 3.10 as its default version.

In this blog, we will explore the utilisation of the PyCharm on Ubuntu 22.04 to establish a comprehensive Odoo 17 development.


Let’s get into it.

Step 1: Download and Install the Pycharm IDE

You can install PyCharm using the following instructions.
* Open Terminal and then execute the following commands one by one:

				
					sudo apt-get update 
sudo apt-get upgrade
sudo snap install pycharm-community --classic

				
			

Step 2: Install Web Dependencies

Odoo 17 relies on several web-related dependencies to ensure the smooth functioning of its front-end and back-end components. These include Git, Python packages, and additional tools like Node.js for asset management. Here’s how to install these:

Run the following commands to install the necessary dependencies:

				
					sudo apt install -y git python3-pip python-dev python3-dev libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev libjpeg-dev libpq-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev

sudo apt install -y npm
sudo ln -s /usr/bin/nodejs /usr/bin/node

sudo npm install -g less less-plugin-clean-css

sudo apt-get install -y node-less

				
			

Step 3: Install the wkhtmltopdf

To make the Prints and Reports, Odoo 17 necessitates a version of wkhtmltopdf that surpasses 0.12.2.
Wkhtmltopdf is utilized for converting HTML content into PDF files utilising Qt webkit.
To proceed, install the following commands:

				
					sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb

sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb

sudo apt install -f

				
			

Moreover, are you interested in knowing how to install Odoo 18 on Ubuntu 24.04 LTS?, Then you can check our blogs on it too.

Step 4: Install PostgreSQL

Installs both the PostgreSQL server and the PostgreSQL client. If both are installed, you can skip the command below.

				
					sudo apt install postgresql postgresql-client

				
			

You will now need to create a PostgreSQL user to manage the PostgreSQL database server. In our instance, we’ll create a PostgreSQL user with the same name as the system user created earlier, which is “odoo17.”

				
					sudo su - postgres

createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo17

				
			

The username and password are required for the configuration file. Make sure you note it somewhere for configuring the file. PostgreSQL utilises a separate system user to execute tasks. To switch to this user, execute the “sudo su -postgres” command. After that, you can create a database user specifically for Odoo 17.

				
					psql
ALTER USER odoo17 WITH SUPERUSER;

				
			

Executing the above command will grant the user superuser access rights. Afterwards, it’s advisable to log out of both Postgres and PSQL.

				
					\q 
exit

				
			

Step 5: Get Odoo 17 Development Source Code

You can obtain the Odoo 17 development Community source code directly from Odoo’s GitHub repository. Alternatively, you can clone it from Git. First, ensure you have Git installed, and then proceed by running the following commands:

				
					sudo apt-get install git
				
			

The following command will clone the Odoo code into a directory named “Odoo17” within your home directory:

				
					git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 --single-branch odoo17

				
			

Step 6: Accessing the Odoo Project in PyCharm

We have now successfully installed PyCharm and cloned Odoo 17 development.
Now, it’s time to configure Odoo17 in PyCharm.
Launch PyCharm and navigate to the Odoo 17 development directory.

NOTE:

Suppose a dialogue box appears for creating a virtual environment after the project is opened. However, since we’ll be creating the virtual environment via the terminal, you can cancel it.

 To access the terminal, either click on the icon depicted below or use the shortcut Alt + F12.

 Execute the commands provided below to create a virtual environment (venv) using Python 3.10:

				
					curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
sudo apt install python3.10-venv
python3.10 -m venv your_venv_name

				
			
how-to-set-up-odoo-17-development-environment-using-pycharm-on-ubuntu-2204

Close and reopen the terminal after executing the above commands to check whether the virtual environment is activated.
If activated, you can see the indicator as displaying the name of your virtual environment in parentheses.

how-to-set-up-odoo-17-development-environment-using-pycharm-on-ubuntu-2204

If the previous command does not activate your virtual environment, you can utilise the following command:

				
					Source your_venv_name/bin/activate

				
			

Note: Do the next step after activating the virtual environment, ie within the virtual environment

Step 7: Installing Necessary Python Packages

You need to execute the following command in the terminal to install the necessary Python packages required by Odoo, which are listed in the “requirements.txt” file within the “Odoo17 development” directory:

				
					pip install -r requirements.txt
				
			
how-to-set-up-odoo-17-development-environment-using-pycharm-on-ubuntu-2204

If you encounter any errors during the installation process, you can individually install each requirement listed in the “requirements.txt” file using the following command:

				
					pip install requirement_name
				
			
how-to-set-up-odoo-17-development-environment-using-pycharm-on-ubuntu-2204

In most cases, when installing packages that are specified twice, only one of them should be installed. Therefore, even if one of them fails to install, it should not be a significant issue.

You can also check our blog on How to Install Odoo 19 on Ubuntu 24.04 LTS

Step 8: Generate the odoo.conf File in the Odoo 17 Development Directory

To create the configuration file, follow these steps:

  1. Right-click on the directory.
  2. Select “New” -> “File” -> “odoo.conf”.
  3. Insert the following block into the “odoo.conf” file.
  4. Update the db_password field with the password you specified for the database user “Odoo17” in the previous step.
				
					[options]
admin_passwd = admin
db_host = localhost
db_port = 5432
db_user = odoo17
db_password = your_password
addons_path = /home/user/odoo17/addons
xmlrpc_port = 8017

				
			

To update the addons_path value with the actual path to the “Odoo 17 development” addons directory, follow these steps:

  1. Navigate to the addons directory.
  2. Press Ctrl + Shift + C to copy the path to the current directory.
  3. Replace the placeholder value in the addons_path parameter in the “odoo.conf” file with the copied path.
				
					eg: addons_path = /home/user/odoo/addons, /home/user/odoo/custom_addons

				
			

Step 9: Add Python Interpreter

Go to Settings -> Project: odoo17 -> Python Interpreter to configure a Python interpreter.

how-to-set-up-odoo-17-development-environment-using-pycharm-on-ubuntu-2204

When you open the mentioned window, if the interpreter (Python 3.10 from the Odoo17 virtual environment) is already configured, no changes are necessary. However, if it’s not set up, follow these steps:

Select the “Add Interpreter” option.

Navigate to the location where the Python interpreter from the Odoo17 virtual environment is located.

Choose the interpreter and confirm the selection.

how-to-set-up-odoo-17-development-environment-using-pycharm-on-ubuntu-2204

Step 10: Add Project Configuration in Pycharm

To configure the settings, navigate to “Edit Configurations” under the “Current File” menu.

how-to-set-up-odoo-17-development-environment-using-pycharm-on-ubuntu-2204

When the dialogue box appears, as shown below, click the “+” button and choose “Python” from the list.

Afterwards, you can fill in the fields as depicted in the image below.

how-to-set-up-odoo-17-development-environment-using-pycharm-on-ubuntu-2204

Name: Provide any desired name for the configuration.

Python Interpreter: Ensure that the Python interpreter is included for this project, which should auto-populate if previously set up.

Script Path: Select the “odoo-bin” file from the “odoo17” directory.

Parameters: Add necessary parameters for script execution, including the required “-c” parameter and any additional parameters as needed. Additionally, include the path to the configuration file.

Working directory: Specify the location of the project’s current working folder.

Step 11: Testing Odoo 17 Development

With Odoo’s setup complete, it’s time to test it out. Simply click the button below to launch the project and see it in action.

how-to-set-up-odoo-17-development-environment-using-pycharm-on-ubuntu-2204

Now, you can test localhost:8017 in your web browser. If all your configurations were successful, the Odoo database management interface will open, resembling the image below.

how-to-set-up-odoo-17-development-environment-using-pycharm-on-ubuntu-2204

This is how Ubuntu 22.04 users may set up an Odoo 17 Pycharm development environment.

For better implementation, you can easily contact our team as well.

Now you're set to build with Odoo 17 Development!

By following this guide, you’ve successfully set up a development environment for Odoo 17 PyCharm on Ubuntu 22.04. This environment will serve as a foundation for developing, customizing, and extending Odoo’s functionality to meet your business needs.

With this setup in place, you’re now ready to explore Odoo 17’s powerful features and build custom applications. 

Happy coding!

Picture of Nabia

Nabia

Hi, I'm Nabia, an Odoo ERP functional & technical content writer. I specialize in blogs, social media content, ad copy, landing pages, service pages, and email campaigns.

Get a free quote