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

  1. First of all, you have to fork Odoo Community from it's official site on GitHub.

    Odoo Community Repository on Github

  2. Click the green button, and copy the link

    Repository Link


  3. 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. Press enter, and wait for it to complete

    Cloning Progress

  5. While you wait, download Pycharm Community from it's official website.

    Pycharm Website


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

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

    brew install postgresql
    


  8. 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 start postgresql
    

    since we are about to run Odoo development, just let it run for now.

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

    psql postgres
    


  10. 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 odoo15 WITH PASSWORD 'odoo15';

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

  12. This should be good. get yourself a coffee, and we will begin to number 12.
  13. 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 Projects

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

    Create New Project


  15. Okay, projects are created. But once this window pop up, you will be asked to make an environtmen 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

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


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

    Edit odoo.conf in main project directory

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

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

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

    Install All Packages

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


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

  23. When everything is done, try to run the step number 21 again. If it's successfull, you might see this log below.

    Odoo has successfully started on 0.0.0:8069

  24. From your computer browser, type in 0.0.0.0:8069 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.