21
www.cybrosys.com HOW TO CONFIGURE PYCHARM FOR ODOO DEVELOPMENT IN WINDOWS?

How to configure PyCharm for Odoo development in Windows?

Embed Size (px)

Citation preview

Page 1: How to configure PyCharm for Odoo development in Windows?

www.cybrosys.com

HOW TO CONFIGURE PYCHARM FOR ODOO DEVELOPMENT IN WINDOWS?

Page 2: How to configure PyCharm for Odoo development in Windows?

INTRODUCTION• Installing Odoo in windows is the really easy task. We

can do it by just running the ‘.exe’ file. But fordevelopment purposes, this method is not preferred.Pycharm is an IDE which can be used for Odoodevelopment in Windows, Linux, and mac. In thisblog, we will discuss setting up Odoo developmentenvironment in windows using pycharm.

Page 3: How to configure PyCharm for Odoo development in Windows?

• These are the steps we need to follow :-

1. Download and install python 2.7 from here

https://www.python.org/downloads/release/python-2713/

based on your system architecture.

Page 4: How to configure PyCharm for Odoo development in Windows?

2. After installing python, we need to install Microsoft Visual C++ compiler.

Go to this link https://www.microsoft.com/en-us/download/details.aspx?id=44266

Download and install it.

Page 5: How to configure PyCharm for Odoo development in Windows?

3. Download PostgreSQL and configure.

https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#windows

Page 6: How to configure PyCharm for Odoo development in Windows?

a. Create a new user for Odoo

• You can either create a user (role) using the pgadmin or directly from the commandprompt. For creating a user with pgadmin, first, configure pgadmin and then go to theroles section and create a new role. Then under the privileges tab of this role, provideall the access.

• From the command prompt, you can create the user with the following commands.

• First, go to the postgresql installation directory using ‘cd’ (usually “C:\ProgramFiles\PostgreSQL”)

Page 7: How to configure PyCharm for Odoo development in Windows?

cd "C:\Program Files\PostgreSQL\9.6\bin"

(Here ‘9.6’ is my postgresql version. Change it accordingly)

createuser.exe --createdb --username postgres --no-createrole --pwprompt odoo

Page 8: How to configure PyCharm for Odoo development in Windows?

• You will be asked for the password, provide a password and remember it. We may need it during odoo installation.

Page 9: How to configure PyCharm for Odoo development in Windows?

4. Now download Pycharm from here https://www.jetbrains.com/pycharm/download/#section=windows and install.

5. Download odoo https://github.com/odoo/odoo/archive/10.0.zip and extract the contents to a folder.

Page 10: How to configure PyCharm for Odoo development in Windows?

6. Open pycharm and create a project with the folder which we have extracted in the last step.

7. Now we need to install some packages for odoo. In the extracted odoo folder, we can find a ‘requirements.txt’ file.

Page 11: How to configure PyCharm for Odoo development in Windows?

> cd C:\ python27 (change to the location where python is installed. You can also do this from any location if you add python path to your system’s path variable.For this, go to My PC > Properties > Advanced System Settings > Environment Variables > and edit the path and add your python path)python -m pip install -r C:\Users\Odoo-10.0\requirements.txt (we have to specify the ‘requirements.txt’ file with its complete path.)

Page 12: How to configure PyCharm for Odoo development in Windows?

8. Download and install pywin32 from here.https://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/You need to download the correct version based on your system architecture and python.Note that you cannot install 64 bit pywin32 on a system with 32-bit python installed. It will show an error saying that ‘Python is not found’.

Page 13: How to configure PyCharm for Odoo development in Windows?

9. Download and install pip.https://bootstrap.pypa.io/get-pip.py . Download the file get-pip.py and move it to python installation location.

>cd C:\python27 >python get-pip.py

Page 14: How to configure PyCharm for Odoo development in Windows?

10. Now we need to configure odoo.

Open pycharm and edit the file ‘odoo-server.conf’ (usually, this file may be inside the Debian folder in odoo’sfolder)

Page 15: How to configure PyCharm for Odoo development in Windows?

• Install Wheel & Lxml-3.6.4-cp27-cp27m-win32.Whl

> cd C:\python27> python -m pip install wheelGo to this link http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml and then from terminal,> python -m pip install lxml-3.6.4-cp27-cp27m-win32.whl

Page 16: How to configure PyCharm for Odoo development in Windows?

• - Install PSYCOPG2 from http://www.stickpeople.com/projects/python/win-psycopg/

• - Install nodejsGo to https://nodejs.org/en/

> cd C:\Program Files\nodejs (here you specify installation location nosejs)> npm install -g less less-plugin-clean-css

Page 17: How to configure PyCharm for Odoo development in Windows?

Install wkhtmltopdf from here https://wkhtmltopdf.org/downloads.html (I prefer using version 12.1)

12.Now we need to create a service with pycharm.

For this, open pycharm and under the run menu, go to edit configurations option and click on the ‘+’ to create a new configuration, select python from the list.

Page 18: How to configure PyCharm for Odoo development in Windows?

• Now we need to select script and script parameters. In the script field, select the odoo-bin file.

• In the script parameters section fill it like this, -c /path to odoo.conf file, i.e., for example, -c /home/odoo/odoo-10.0/odoo.conf.

• Now we can run Odoo from pycharm.

Page 19: How to configure PyCharm for Odoo development in Windows?

• Now we can run Odoo from pycharm.

Page 20: How to configure PyCharm for Odoo development in Windows?

Refer this link for more:

https://www.cybrosys.com/blog/configure-pycharm-odoo-development-windows

Page 21: How to configure PyCharm for Odoo development in Windows?

Thank You !

Cybrosys Technologies Pvt. Ltd.Neospace, Kinfra Techno Park,Kakkancherry,Calicut University P.O.CalicutKerala, India - 673635.

Cybrosys Ltd15, ST Antonys Road,Forest Gate, LondonEngland,E79QA.

Cybrosys Technologies Pvt. Ltd.1st Floor, Thapasya Building,Infopark, Kakkanad,Kochi, Kerala,India-682030.