Odoo is a popular ERP suite that comes with a website builder, CRM and many other tools for building enterprise management applications. In this article, we will look at how to configure Odoo 13 with PyCharm.
How to Configure Odoo 13 with PyCharm
Here are the steps to configure Odoo 13 with PyCharm. You need to be logged in as a user with sudo or root privileges to follow these steps.
1. Update System
Open terminal and run the following command to update your Ubuntu system.
$ sudo apt-get update $ sudo apt-get upgrade
2. Install PyCharm
Next, install Pycharm with the following command.
$ sudo snap install snap install pycharm-professional --classic
3. Install Python packages & libraries
After we install PyCharm, we need to install a few python packages & libraries with the following command.
$ 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
4. Install Wkhtmltopdf
We need to install Wkhtmltopdf to allow Odoo to export PDF reports.
$ 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
We also need to install the following web dependencies.
$ 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
5. Install PostgreSQL
Odoo uses PostgreSQL database to store information. Install PostgreSQL with the following command.
$ sudo apt-get install postgresql
We need to create a PostgreSQL user that will be used by Odoo to interact with PostgreSQL database.
$ sudo su - postgres $ createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo13
Alter the password of new user with following commands.
psql ALTER USER odoo13 WITH SUPERUSER;
Enter \q to exit psql shell, and ‘exit’ command to exit postgres Ubuntu user.
6. Clone Odoo from GitHub
We need to clone Odoo’s github repository. First we install git on our system.
$ sudo apt-get install git
Next. we clone odoo’s git repository.
$ sudo git clone https://www.github.com/odoo/odoo --depth 1 --branch 13.0 --single-branch .
7. Install Python dependencies for Odoo
Odoo’s python dependencies are listed in the file requirements.txt. You can run either of the following commands to install them. Replace <path> with the installation path of Odoo.
$ sudo pip3 install -r requirements.txt OR $ sudo pip3 install -r <path>/requirements.txt
8. Configure Odoo
Next, we need to create Odoo’s configuration file. You can easily do this by opening PyCharm IDE, clicking Open Project and navigating to Odoo’s installation folder, and creating a new file odoo.conf.
Add the following lines to it.
[options] ; This is the password that allows database operations: ; admin_passwd = admin db_host = False db_port = False db_user = odoo13 db_password = <enter database password> addons_path = /home/user/odoo/addons
Enter database user password for db_password parameter. Save and close the file.
9. Add Configuration in PyCharm
Next, add configuration in PyCharm by clicking Add Configuration button on top right corner of IDE.
You will see a dialog box. Click + button and select python. Enter the settings as shown.
Name: Name of Configuration
Script Path: Select the ‘odoo-bin’ file from odoo directory.
Parameters: Provide the conf file using -c parameter.
Python Interpreter: Select Python Interpreter here.
Test Odoo Installation
Now test the configuration by clicking the run button. If Odoo runs without any error or issue the last line of log should show message like
odoo.service.server: HTTP Service (..) running on ...
That’s it. In this article, we have learnt how to install Odoo with PyCharm in Ubuntu.
Install Odoo with Apache Reverse Proxy
How to Setup PostfixAdmin in Ubuntu
How to Completely Uninstall PostgreSQL from Ubuntu
How to Setup NTP Server & Client in Ubuntu
How to Add User to Sudoers in Linux