Odoo 15 is the newest version of Odoo, which is the most advanced and prominent version of the software to achieve ultimate business management with dedicated tools and functional options. Odoo 15 uses Python 3.8+ for the backend development, PostgreSQL for the database server, and JavaScript for the frontend development.
In this blog, we will discuss how to set up a development environment for Odoo 15 using Pycharm IDE.
So before configuring PyCharm, we need to initially install some necessary libraries and packages to run Odoo. Let’s look at that step by step.
Step 1: Install Pycharm IDE
Pycharm is available in 3 different Editions: Education, Community, and Enterprise. Here we are going to install the Pycharm Community edition and to run Pycharm you need certain minimum system requirements.
Requirement | Minimum | Recommended |
Operating System | 64-bit of Linux distribution that supports Gnome, KDE, or Unity DE, Microsoft Windows 8 or later, and macOS 10.13 or later |
The latest 64-bit version of Windows, macOS, or Linux |
RAM | 4 GB of free RAM | 8 GB of total system RAM |
Disk Space | 2.5 GB and another 1 GB for caches | SSD drive with at least 5 GB of free space |
To install Pycharm, you can directly download the Debian installation file from the following link: Download Pycharm
Or Open Terminal (you can use Ctrl + Alt + T to open terminal) and execute the following commands:
sudo apt-get update
sudo apt-get upgrade
sudo snap install pycharm-community --classic
sudo apt-get install -y python3-pip
sudo apt-get install python-dev python3-dev build-essential libjpeg-dev libpq-dev libjpeg8-dev libxml2-dev libssl-dev libffi-dev libmysqlclient-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev liblcms2-dev
sudo apt-get 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
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
sudo apt-get install postgresql
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo15
psql
ALTER USER odoo15 WITH SUPERUSER;
q
exit
Otherwise, you can clone it from git. For that you have to install git, follow the below commands:
sudo apt-get install git
git clone https://www.github.com/odoo/odoo --depth 1 --branch 15.0 --single-branch odoo15
cd odoo15
sudo pip3 install -r requirements.txt
sudo pip3 install -r <path to inside odoo directory>/requirements.txt
After loading the project, a dialogue box may appear as shown in the below screenshot. If you want to use a virtual environment you can select OK, but here we are not using a virtual environment. So Cancel it.
Step 10: Create odoo.conf File inside odoo15 Directory
Right-click on the directory -> New -> File -> odoo.conf
Paste the following block into the file odoo.conf, and you should change the db_password, which is the password you set for the database user odoo15 in the earlier step.
[options]
; Is This The Password That Allows Database Operations:
admin_passwd = admin
db_host = localhost
db_port = 5432
db_user = odoo15
db_password = False
addons_path = /home/user/odoo/addons
xmlrpc_port = 8015
And also change the addons_path value with the actual path of the addons directory inside odoo15.
To get the path select the directory and press Ctrl + Shift + C. Then you will get the path of the current directory. Replace it in the addons_path. You can also create another directory to add your custom modules, and that directory’s path also needs to be added in the addons_path separated by commas.
eg: addons_path = /home/user/odoo/addons, /home/user/odoo/custom_addons
Step 11: Add Python Interpreter
Go to File -> Settings -> Project: odoo15 -> Python Interpreter
Click on the marked icon in the below screenshot and select the Add option available.
From the next dialogue box select option System Interpreter and the Python version on the right filed.
Step 12: Add Project Configuration in Pycharm
Click the Add Configuration button in the below screenshot
Then the following dialogue box will appear, click the ‘+’ button and select ‘Python’ from the list
Then you can fill the fields as the ones shown below screenshot.
Name: you can provide any name to identify the configuration.
Script Path: Select file ‘odoo-bin’ file from odoo15 directory.
Parameters: Here you can add the parameters to run along with the script, -c is the required parameter and provide a conf file along with it and multiple parameters can be added.
Python Interpreter: Python Interpreter of this project should be added here. It will automatically fill there because we already set the interpreter in the previous step.
Step 13: Test Run Odoo 15
Configuration of Odoo is completed, now you can test it by running the project by clicking the button below.
And you can see the status in the log as shown below:
Now you can try it on your browser and check localhost:8015
If all your configuration was successful, the browser will navigate to the database manager of Odoo as shown below:
With the new Odoo version 15, you will be able to manage the business with dedicated and well-defined tools that are available that will support the aspects of the business operations at all levels.
Also Check How to setup Odoo 17 Development Environment Using Pycharm & have a look at the following blog to explore more about How to Install Odoo 16 on Ubuntu 22.04. How to Install Odoo 16 on Ubuntu 22.04