Install Odoo with Pycharm Community Version in Mac
Hi again,
So few days after Christmas i plan to learn how to create Odoo module. I'm still really far from having deeper understanding with python actually, but that's okay.
So anyway, before we begin, you have to understand that Odoo ERP in general are running along with Postgresql as it's database. PyCharm is providing you an environment to run both, so it's possible to have Odoo development and can be accessed from your localhost. But, that's only happen if you have a PyCharm Professional edition. I was kinda sad that i have to pay since i only willing to do a trial, but then i realized that it's possible to run postgresql standalone, and connect my odoo development too it via port 5432 using PyCharm community edition.
Sounds confusing? well, don't be.
We will through all of this together.
- First of all, you have to fork Odoo Community from it's official site on GitHub.
Odoo Community Repository on Github - Click the green button, and copy the link
Repository Link - Jump into your terminal, type in :
git clone --branch <branchname> <remote-repo-url>
- While you wait, download Pycharm Community from it's official website.
Pycharm Website - Later on, leave both process to complete. We move on to installing homebrew. Homebrew is a packages repository of mac and linux. Open a new tab of your terminal, and type in :
/bin/bash -c"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- After homebrew is finished installing, get yourself a postgresql database by typing :
brew install postgresql
- Wait until the process done, and then make sure that postgresql are installed by typing :
brew services start postgresql
the command above is used if you want to start postgresql service on your mac. remember that running a postgresql will consume your mac resources, so when you feel like you don't need it you can stop the process by typing :brew services stop postgresql
since we are about to run Odoo development, just let it run for now. - Then, we need to enter into postgresql terminal-based database query by typing :
psql postgres
- Now, we are going to create a user that later connects odoo and postgresql. Since we are using odoo14, and as an example we will create a postgres user that has a name odoo14 and the password is also odoo14. So, the query will be :
CREATE USER odoo14 WITH PASSWORD 'odoo14';
- Then, give permission to it by typing
ALTER USER odoo14 WITH SUPEROLE; ALTER USER odoo14 WITH CREATEROLE; ALTER USER odoo14 WITH CREATEDB; ALTER ROLE odoo14 VALID UNTIL 'infinity';
- This should be good. get yourself a coffee, and we will begin to number 12.
- After that, open PyCharm terminal on the bottom tab of your screen, and type this command to run odoo
python3 odoo-bin --addons-path addons -r odoo14 -w odoo14
- After it's done, try to run a command from step 18. Since i'm kind, i'm not gonna let you scroll up but copy-pasting the command here.
python3 odoo-bin --addons-path addons -r odoo14 -w odoo14
- If you still have an error, try to run and install the packages manually in terminal by typing
pip3 install <your-dependency-name>
To understand which dependency are missing, you have to check the error message that appears during installing requirement.txt. here's one of the example :pip3 install docutils
The command above means installing docutils with python3.
If "pip3" cannot do any installation, try to use "pip" or "pip2". It's all based on which python you are installing during creating a project at first.