DEV Community

Cover image for How to Install Odoo on Mac OS (Silicon Valley Chips) Using PyCharm
a_moah__
a_moah__

Posted on

How to Install Odoo on Mac OS (Silicon Valley Chips) Using PyCharm

Introduction

Odoo is a powerful and versatile open-source business application suite that includes a wide range of modules for various business needs, such as CRM, accounting, inventory, and more. If you’re a developer working on a Mac and prefer using PyCharm as your Integrated Development Environment (IDE), this guide will walk you through the process of installing Odoo on your Mac OS using PyCharm.

Prerequisites

The Process

Install Homebrew. Homebrew is a package manager for Mac that will make the installation process much smoother. Open your terminal and execute the following command to install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install git using brew

brew install git

Install NodeJS

npm install -g npm

Install python, pycharm, postgreSQL, PGAdmin4 and visual studio by following the above link to continue the process below.

Using your preferred location, create the folder for your odoo community. Now let say you have a directory “/Users/username/Documents/odoo/v15/odoo-server”. Please note that username will be your Mac username. Open your terminal and go inside the above directory by using terminal. Clone the odoo v15 repository by following the the command below:

git clone https://www.github.com/odoo/odoo --depth 1 --branch 15.0.

It is advisable to use virtual environment so that python module packages will not mix with other Odoo instances or python versions. To create virtual environment, first go to “/Users/username/Documents/odoo/v15” in your terminal and run the following command:

python3 -m venv odoo_venv

After the above command, your v15 folder should be as follows:

Image description

Since we will be using pycharm, ensure that postgreSQL is running

Image description

For security reason, we will not be able to use default postgres user. To create a new user, open pgAdmin 4. For first time use, it will ask for password.

Go to Servers - Localhost and right click Login/Group Roles and select Create - Login/Group Role…

Image description

In General, type name and add password in definition. Lastly, under privileges, toggle Can Login and Create Databases. Click Save.

Image description

Now, create a new folder under "Users/username/Documents/v15" and name it tutorial_theme. Open tutorial_theme with pycharm.

By default, PyCharm will create a new file main.py but delete it. Inside tutorial_theme folder, create Odoo configuration by creating a new file called odoo.conf. Add the following code to the odoo.conf file in pycharm:

[options]
admin_passwd = 1
db_host = False
db_port = False
db_user = trial
db_password = trail
dbfilter = ^tutorial_theme.*$
db_list = True
addons_path = /Users/username/Documents/odoo/v15/odoo-server/addons
http_port = 8069
Enter fullscreen mode Exit fullscreen mode

Add virtual environment by going in PyCharm - Preferences - Project - Python Interpreter. Check the link of the current python interpreter you created under "Users/username/Documents/odoo/v15/odoo_venv, then click gear icon on the right side and click add to add it.

Select Existing Environment and locate python3 file which is located inside "odoo_venv/bin/python3". Click apply and okay button.

Edit the PyCharm configuration by clicking on the menu bar. By default, it creates a new configuration "main". Click main and click the minus (-) button on top left to delete it.

Image description

Click on the plus (+) button to add new and choose Python. Copy the code below for the script path and parameters. Please replace the code based on the location of your file. Click apply and OK.

Script Path: /Users/username/Documents/odoo/v15/odoo-server/odoo-bin 
Parameters: -c "/Users/username/Documents/odoo/v15/tutorial_theme/odoo.conf"
Enter fullscreen mode Exit fullscreen mode

Run Odoo by clicking green arrow in the toolbar.

Image description

Go to the browser on type the url http://localhost:8069. You will be redirected to http://localhost:8069/web/database/manager since there are no database created.

Image description

If you face the bug below:

Image description

Undertake the following action to fix the problem:

Image description

Re-run odoo from pycharm and go back to the browser to type the url http://localhost:8069.

This should work perfectly!!!
You just installed odoo on MacBook silicon valley chip using pycharm!!!

Top comments (0)