Post init hook in the odoo 17 ERP Module

CelineGeorge1 740 views 7 slides Jun 21, 2024
Slide 1
Slide 1 of 7
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7

About This Presentation

In Odoo, hooks are functions that are presented as a string in the __init__ file of a module. They are the functions that can execute before and after the existing code.


Slide Content

Post init hook in Odoo 17

Introduction Enterpr ise In Odoo, hooks are functions that are presented as a string in the __init__ file of a module. They are the functions that can execute before and after the existing code. Post_init_hook are the functions that executes after the module installation. These functions are included by specifying their names within the __init__.py file and are typically responsible for generating certain data.

Enterprise First of all we need to add post init hook in the manifest file of the module. In the post init hook need to specify the method to execute after installing the module.

Enterprise Then we need to define the post init method in the __init__ file of the module. This method that executes after installing the module will help to create records as a sample one.

Enterprise Then we need to install our module from the apps.

Enterprise After installing the module, if we go to our module here, you can see a record automatically created data by default.

For More Info. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com