In this tutorial i will explain how to set up both Odoo10 and Odoo11 in Windows10 for development purpose. We will be configuring the Odoo10 in normal system environment where as Odoo11 will be in virtual environment, so that we can avoid any future glitches of having both python versions. You can configure both Odoo in conversely also ,or both in virtual environment.
Like all tutorials i have divided whole configuration to 4 tiers so that everyone can easily understand.
There are few application that we needed for both version. In this phase we will be setting up
Configuring Git In Windows
For installing git you can download the windows executable from here. Git can be used for downloading the Odoo code repository. So that we can be upto date with any changes. This will install the git bash which is similar as the linux shell. so you can use some linux commands also.
Odoo uses PostgreSQL as it's primary database, you can download it from their official site. When installing be sure to remember the PostgreSQL root user password, superuser by default will be postgres. To access the
psql interpreter, first you need to add the PostgreSQL bin directory to the windows system environment. Don't overwrite any variables that already in there. The default bin directory is
Then you can use any commands provided by psql interpreter in windows command prompt or in git bash. For more information on the psql commands you can check this cheat sheet.If you can not execute psql commands, it may be because of this error.For odoo to create database, we need to create new role for the Odoo. It can be done as follows.
Node.Js is for installing the css preprocessor that is used to handle the Odoo css files. Node for windows can be download from here. Node packages can be installed using the
npm, which is the default packet manager for Node and comes in default. After installing it, you can type
node --version in command prompt to verify it.
In order to print pdf reports in Odoo we have to install the
wkhtmltopdf. It can be found here. Remember to download the
0.12.1 version because Odoo10 and Odoo11 is more compatible with that. After that add the bin folder to the system environment variables, so that it can be used by Odoo. Type
wkhtmltopdf --version in command prompt to verify the installation.
After setting up the common applications, next we need to download the
python2.x from here. Remember to download the 32 bit version, because python package support is more in 32 bit version. After installing the python, add the installed folder to system environment variables. The two paths you needed to add are
C:\Python27\Scripts, latter one is for enabling the use of
pip in command prompt.
Then clone the Odoo to the desired path using the following command. and install the python dependencies using the pip, dependency list can be found in the
requirements.txt file inside the Odoo folder.
If any error occurs, you have to install the packages one by one. After installation go the cloned odoo directory which has the
odoo-bin file. Use the command prompt or git bash to run the Odoo using the following CLI command.
In the command we have to specify the postgres
password. So use the role
(-r odoo) and password
(-w odoo) you provided.If you get any error on
win32service. You can get the 32 bit version from here. If everyhting ok you can see the working Odoo in the default ip address
localhost:8069. You can change the parameters of the CLI, for that please check my tutorial on that. Also don't forget to allow exception for python in the windows firewall.
We will be installing Odoo11 in an virtual environment because Odoo11 uses python3.x, we have to download the python3.x latest from their official site. Install it in the folder
C:\Python36. Then change the python script inside that to
python36, so that we can distinguish between both version. Finally add directory to the system environment variable list.
Now next step is to create a virtual environment using the python3.x.It can be done by the following command on command prompt.
Next we have to clone the Odoo11 from the git repository using the following commands.
Activate the venv using the above command, you can verify python version and which python is we using by
pip --version command. After that go to the Odoo11 cloned folder and install the python dependencies using the above command. For this follow the same steps that i described for Odoo10 here also. If you get the
win32service import error install it using the command
pip3 install pywin32. Last but not least run the Odoo11 as follows. And can see the Odoo11 running on
deactivate the venv once it is done.
Consider this tutorial as a basic guide for setting up an Odoo development environment in Windows10. You can switch the setup anyway you like it. For additional reference on troubleshooting, you can check this site. For development IDE you can either use
Eclipse. And there is also a new CLI command
--dev=all which enables developers to see the result in Odoo without upgrading the module when we change a view definition.Try setting up your own development environment and happy coding.