Developers can run the entire OpenG2P package on their machines. The guide here provides steps to install OpenG2P on a laptop/desktop running Linux.
- A Linux server
- Python3
- Git
- PostgreSQL
- Odoo 15.0
- Log in to your Linux server using SSH and update the package list and upgrade the existing packages:
sudo apt update
sudo apt upgrade -y
- Odoo requires several dependencies to function correctly. Install them using the following commands:
sudo apt install -y python3-pip python3-dev build-essential libxml2-dev libxslt1-dev libevent-dev libsasl2-dev libldap2-dev libpq-dev libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev libopenjp2-7-dev libtiff5-dev libffi-dev nodejs npm
-
It is recommended to create a separate system user to run Odoo for security purposes. Create the user with the following command:
sudo adduser --system --home=/opt/odoo --group odoo
-
Install PostgreSQL server and create a new database user for Odoo:
sudo apt install -y postgresql sudo su - postgres createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo_user exit
-
Odoo supports printing reports as PDF files. Wkhtmltopdf helps to generate PDF reports from HTML data format. Moreover, the Qweb template reports are converted to HTML format by the report engine and Wkhtmltopdf will produce the PDF report:
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
-
Clone the Odoo 15 repository from the official GitHub repository:
sudo git clone https://github.com/odoo/odoo.git -b 15.0 /opt/odoo/odoo15
{% hint style="danger" %} Cloning the odoo15 repo takes time because of the large file. {% endhint %}
-
Make a new Odoo Python virtual environment:
cd /opt/odoo python3 -m venv odoo-venv
-
Turn on the virtual environment:
source odoo-venv/bin/activate
-
Switch to the Odoo 15 directory and install the required Python libraries:
sudo chown -R <odoo_user>: /opt/odoo/odoo15 cd /opt/odoo/odoo15 pip3 install wheel pip3 install -r requirements.txt
-
Edit the configuration file
/opt/odoo/odoo15/debian/odoo.conf
and set the appropriate values for the following parameters:\sudo nano /opt/odoo/odoo15/debian/odoo.conf
[options] addons_path = /opt/odoo/odoo15/addons admin_passwd = strong_admin_password db_host = localhost db_port = 5432 db_user = odoo_user db_password = your_database_password
-
Start the Odoo server using the following command:
/opt/odoo/odoo15/odoo-bin -c /opt/odoo/odoo15/debian/odoo.conf
-
Create a
custom-addons
folder inside theodoo15
folder to keep all the extra modules. -
Clone all the OpenG2P modules:
git clone <repo_url>
-
Install the required Python libraries for all the custom addons:
cd /opt/odoo/custom-addons/<module_directory> pip3 install -r requirements.txt
-
Add addons directory path to the odoo15.conf file.