Skip to content Skip to sidebar Skip to footer

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. To create a development environment, we are going to use IDE (Which stands for Integrated Development Environment) named PyCharm. 

What are we going to achieve in this blog tutorial : 

  • Installed git in your system. Most unix and mac (especially latest version) is preinstalled along with first OS installation.
  • Installed PyCharm Community Edition IDE, which you can obtained from it's website here.
  • Python 3, latest version would be better. Most mac machine has python 2.7, thus upgrading it to version 3 is better.
  • Homebrew (Mac package manager)

  1. First of all, you have to fork Odoo Community from it's official site on GitHub. You might want to refer to my other blog post on how to fork a github repository.
    Odoo Community Repository on Github

  2. Click the green button, and copy the link.

    Repository Link

  3. Open and jump into your terminal, type in : .

    git clone --branch branchname remote-repo-url

    Based on the official odoo repository, branch name is also the version of Odoo. You can see it on the dropdown on the left. For this tutorial, we are going to use version 14.

    Odoo version in branch

  4. Therefore, the git command would be :

    git clone --b 14.0

  5. Press enter, and wait for it to complete
    Cloning Progress
  6. While you wait, download Pycharm Community from it's official website.

    Pycharm Website

  7. 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"

  8. After homebrew is finished installing, get yourself a postgresql database by typing :

    brew install postgresql

  9. Wait until the process done, and then make sure that postgresql are installed by typing :

    brew services start postgresql

  10. 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

  11. Then, we need to enter into postgresql terminal-based database query by typing :

    psql postgres

  12. 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';

  13. Then, give permission to it by typing

    ALTER ROLE odoo14 VALID UNTIL 'infinity';
  14. Let's say that all of your downloads are done. Now, install your pycharm on your mac machine. Then, create a new project

    List of Project

  15. Get everything filled like this picture below. Location is the place where your downloaded odoo placed.

    Create New Project

  16. Okay, projects are created. But once this window pop up, you will be asked to make an environment which later be an "emulator" of your odoo. If you are confused where to place it, just put it inside your odoo project folder.

    Creating Virtual Environment

  17. Now, on the project directory on the left, get into Debian folder, and search for odoo.conf. Right click it, and paste it on your main project directory.

    copy odoo.conf from Debian folder

    pasting odoo.conf to main project file

  18. Open that odoo.conf file in the main project directory, and put information as picture below

    Edit odoo.conf in main project directory

  19. 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
  20. I bet you, an error would happen. hahaha. it's ok, it's just a python dependency that odoo needs to run, but it's not yet installed in your project directory. So the solution is quite simple, you just have to find a requirement.txt and double click it.

    double click requirements.txt

  21. Then, on the right panel, right click and select install all packages

    Install All Packages

  22. 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

  23. If you still have an error, try to run and install the packages manually in terminal by typing

    pip3 install <your-dependency-name>

  24. 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.

  25. From your computer browser, type in and you shall see this pops.

    Odoo Succesfully Started

Congrats, Odoo development environment using Pycharm are successful. Now, you can try to make database on the web interface and doing your development.

Post a Comment for "Install Odoo with Pycharm Community Version in Mac"