Enable Dark Mode!
odoo-13-module-development-with-pycharm-templates.png
By: Sayooj ao

How to Simplify Odoo 13 Module Development with Pycharm Templates

Technical Odoo 13

In this blog, we are going to discuss how we can save time and simplify a custom module development using the pycharm templates. Usually, we may spend a lot of time building the basic structure including manifest, python and view files. Most of the developers are following a method of copying the required files from the existing modules, later redefining it the way they need. It is seen rarely the developers adopting manual typing.


Odoo Pycharm templates help the developers to develop Odoo modules faster and with no Typing Errors.


Odoo Pycharm templates can be installed in two ways

1. Installation from “settings.jar”.

2. Manual Installation.


First, we can look towards the installation using the “settings.jar” and how it will help us during the odoo development.


> You can install settings.jar from the following link Odoo-Pycharm template.


> After downloading the file, go to your Pycharm -> Files -> Import settings.


odoo-13-module-development-with-pycharm-templates-cybrosys


From this, we can import the “settings.jar” file which we downloaded earlier.


> After importing Go to File | Invalidate Caches / Restart the pycharm in the latest versions of pycharm there will be a popup asking for restart automatically.


> After restarting the Pycharm, our Odoo-Pycharm installation will be completed.


Now we can check the use of odoo-pycharm templates in module development.


Basic Python


1. Loading template of the manifest (odoo_manifest)


Input:


odoo-13-module-development-with-pycharm-templates-cybrosys


Output:


odoo-13-module-development-with-pycharm-templates-cybrosys


2. Loading import (odoo_import)


Input:


odoo-13-module-development-with-pycharm-templates-cybrosys


Output:


odoo-13-module-development-with-pycharm-templates-cybrosys


3. Loading class and objects(odoo_object and odoo_object_inherit)


Input:


odoo-13-module-development-with-pycharm-templates-cybrosys


Output:


odoo_object


odoo-13-module-development-with-pycharm-templates-cybrosys


> odoo_object_inherit


odoo-13-module-development-with-pycharm-templates-cybrosys


Common Python Functions


1. Loading onchange and compute function (odoo_onchange , odoo_method_onchange and odoo_method_compute_field)


Input: 


> odoo_onchange


Output:


odoo-13-module-development-with-pycharm-templates-cybrosys


Input:


> odoo_method_onchange


Output:


odoo-13-module-development-with-pycharm-templates-cybrosys


Input:


> odoo_method_compute_field


Output:


odoo-13-module-development-with-pycharm-templates-cybrosys


These are some of the important use of the pycharm template in odoo python. These templates also offer the option for declaring all types of fields such as Many2one(odoo_field_many2one), Many2many(odoo_field_many2many).


Some of the keywords which can use in views(.xml)


1. odoo_menuitem_root (For creating Parent menu item)

2. odoo_menuitem_action (For creating Sub-menu)

3. odoo_view_action (For creating action)

4. odoo_search (For creating search view)

5. odoo_tree (For creating new tree views)

6. odoo_tree_inherit (For creating inherited tree views)

7. odoo_form (For new form views)

8. odoo_form_inherit (For creating inherited form views)

9. odoo_security_rule (For creating the security rule) 


Manual Installation and template customization


1. We will get the XML file of the template by extracting the settings.jar(odoo.xml)


2. Move the Odoo.xml file to templates of PyCharm IDE.


-In ubuntu
Path: ~/.PyCharm*/config/templates
-In Windows
Path: ~/Library/Preferences/PyCharm*/templates


3. After moving the file restart the pycharm and then we can use the odoo templates in pycharm, we can also customize the templates by editing the odoo.xml file


If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

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

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message