-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Odoo Development Cookbook
By :

In Chapter 6, Managing Module Data, you learned how to add, update, and delete records from XML or CSV files. Sometimes, however, the business case is complex, and it can’t be solved using data files. In such cases, you can use the init
hook from the manifest file to perform the operations you want.
Complex business cases may require dynamic initialization of data beyond standard XML or CSV files. Examples include integrating with external systems, performing complex calculations, or configuring records based on runtime conditions, facilitated by the init
hook in the manifest file.
We will use the same my_hostel
module from the previous recipe. For simplicity, in this recipe, we will just create some room records through post_init_hook
.
To add post_init_hook
, follow these steps:
__manifest__.py
file with the post_init_hook
key:... 'post_init_hook': 'add_room_hook...