SlideShare a Scribd company logo
www.cybrosys.com
External Dependencies ,Pre Init
Hook & Post Init Hook In Odoo
INTRODUCTION
When we creating a module in odoo important thing is
__manifest__.py( for odoo 10.0 and later versions) or
__openerp__.py(for odoo 9.0 and earlier versions).
In manifest file, we can define
1) name (str, required):- Human readable name of the module(other than
technical name)
2) version(str) :- Module version(should follow version rules).
3) summary(str):- Short description of the module.
4) description (str):-Extended description for the module.
5) Author (str):- Module author’s name.
6) Website (str):- Module author’s website URL.
7) License (str, defaults: AGPL-3):- Distribution license for the module.
8) Category (str, default: Uncategorized) :- Classification category within Odoo.

Recommended for you

Odoo - Smart buttons
Odoo - Smart buttonsOdoo - Smart buttons
Odoo - Smart buttons

1. What are Smart Buttons? 2. From Regular Buttons to Smart Buttons 3. Magic! (not really) 4. Customizing the Look 5. Customizing the Content

 
by Odoo
openerpopenerpdaysodoo
View Inheritance in Odoo 16
View Inheritance in Odoo 16View Inheritance in Odoo 16
View Inheritance in Odoo 16

View Inheritance can be defined as the process of modifying an existing view. This may be adding a new field to an existing view, adding button, adding attribute to an existing field etc.

odoo erpodoo 16viewinheritance
Working with arrays in php
Working with arrays in phpWorking with arrays in php
Working with arrays in php

This document discusses working with arrays in PHP. It covers array basics like creating and accessing arrays, looping through arrays with foreach and for loops, modifying arrays by adding/removing elements and sorting arrays. It also discusses multidimensional arrays, how to create them and access elements within them.

one dimensional arraymulti-dimensional arraysorting arrays
9) depends (list(str)):- Depended on odoo modules which must be loaded before the module.
10) Data (list(str)):- Path of all data files from the root directory which must always be
installed or updated with the module.
11) Demo (list(str)):- Path of all demo data files which are only installed or updated in
demonstration mode.
12) auto_install (bool, default: False):- If True, the module will automatically be installed if
all dependent modules are installed.
Except for those keys in odoo __manifest__.py we have some special keys for module
compatibility check, adding required dependencies and for running scripts during module
installation.
Those keys are
-pre_init_hook
-External_dependencies
-post _init_hook
External dependency
In __manifest__.py file external_dependency key is used for declaring all external libraries
(python packages or any binaries) that have to be installed to make the module work.
External dependencies are defined in __manifest__.py file under external dependency key
like below
Check if some system application exists:

Recommended for you

How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15

Odoo helps you to set constraints to variants which we can perform using python and model constraints. In odoo python constraints are specified along with methods. This Slide will provide an insight on python and model constraints in Odoo 15. In python, constraints are defined along with a method decorated with constraints().

odooodoo slidesodoo erp
How to Build Custom Module in Odoo 15
How to Build Custom Module in Odoo 15How to Build Custom Module in Odoo 15
How to Build Custom Module in Odoo 15

This slide discusses building a custom module in #odoo15 and also detail each component in the module such as models, views, security, and how can we add those files and set up a module.

odoo erpodoo custom moduleodoo 15
Odoo ORM Methods | Object Relational Mapping in Odoo15
Odoo ORM Methods | Object Relational Mapping in Odoo15 Odoo ORM Methods | Object Relational Mapping in Odoo15
Odoo ORM Methods | Object Relational Mapping in Odoo15

ORM(Object Relational Mapping) is a concept or technique which acts as a bridge between your programming language and your database. Object Relational Mapping helps to execute SQL queries without writing them explicitly. Once the ORM is configured in an application, the user can use the OOP concepts like classes and objects to interact with the database. ORM methods are one of its strong features which helps in executing SQL queries without writing them down explicitly. With the help of ORM methods, the user can implement the OOPS concepts to interact with the database. Odoo creates and manages tables for us inside the database. Thus reducing our work of creation of tables using the queries.

odoo
If someone created a module in odoo, which uses Python modules for its working.
So at the time of module installation if the system does not find Python packages or any
binaries defined in __maifest__.py installed in the system, it will raise an error and not
allow to install the module.
For example:
In Odoo's ‘Weighing Scale Hardware Driver’ module’s __manifest__.py file there is a line
• For defining python dependency file ‘scale’ for the module ‘Weighing Scale
Hardware Driver’, and this module allows the point of sale to connect to a scale
using a USB HSM serial scale interface such as Mettler Toledo Ariva.
• The module requires Python dependency of ‘scale’ library, so in the module they
use external_dependencies’.
• So at the time of module installation, if the system does not find ‘scale’ library
installed, it will raise an error and not allow to install the module.
Pre Init Hook:
• The ‘pre_init_hook‘ is also a special key available in __manifest__.py.
• During installation, when the user clicks to install the custom module, it will call a Pre-
installation hook and do some initialization, copying of files or other and then after that
once it finished, we can capture the return installation process of Odoo and run a Post-
installation hook.

Recommended for you

GET and POST in PHP
GET and POST in PHPGET and POST in PHP
GET and POST in PHP

The document discusses GET and POST methods in PHP. GET retrieves data from forms by sending name-value pairs in the URL, while POST sends data invisibly within the request. GET has limits on data size and is less secure, while POST has no size limits and is more secure. Both populate the $_GET and $_POST superglobals in PHP. The $_REQUEST variable contains data from GET, POST, and cookies to retrieve form data regardless of submission method.

phpmysqlget & post in php
What is Delegation Inheritance in Odoo 15
What is Delegation Inheritance in Odoo 15What is Delegation Inheritance in Odoo 15
What is Delegation Inheritance in Odoo 15

In delegation inheritance provides more flexibility, we use the _inherits attribute. This is used if you want to sink another model in your current model without affecting the views. So the database tables contain fields in your model and also a field representing the inherited objects.

odooodoo slides
Security: Odoo Code Hardening
Security: Odoo Code HardeningSecurity: Odoo Code Hardening
Security: Odoo Code Hardening

This document provides an overview of software security best practices and common vulnerabilities for Odoo code. It discusses the top 10 risks including injection, broken authentication, sensitive data exposure, XML external entities, broken access control, security misconfiguration, cross-site scripting, insecure deserialization, vulnerable components, and insufficient logging. For each risk, it provides examples of vulnerable code and recommendations for more secure implementations. It emphasizes that the Odoo framework includes mechanisms to prevent many mistakes but knowledge and mindset are also key. The document concludes with recommendations for code reviews to check access control, permissions, templates, evaluations, injections, and cross-site scripting prevention.

 
by Odoo
securityodoocode
• The pre init hook is called with a database cursor and may perform modifications in the
database to prepare for the module installation.
• You can use pre_init_hook’ before registering the module's logic in the ir.module.module.
It is commonly used for modules compatibility check.
For using the pre_init_hook define this key in your __manifest__.py and assigning it’s a
method created in your __init_.py of the module(Value of the key is the name of a Python
function which must be defined in __init__.py).
For Example :
As many times we also have validated that the module build for Odoo 8 should not be
installed in Odoo 9 in that case we use pre_init_hook .
Post Init Hook:
• The post init hook is called with a database cursor and registry object and may perform
modifications in the database to finalize the module installation.
• We can define the ‘post_init_hook‘ in the same ways as pre init hook.

Recommended for you

How to Make Sequence Number in Odoo 16
How to Make Sequence Number in Odoo 16How to Make Sequence Number in Odoo 16
How to Make Sequence Number in Odoo 16

In Odoo 16, the sequence number is a field used to assign a unique, incremental number to records in a specific model. It helps in maintaining the order or sequence of records and can be useful in various scenarios.

how to add sequence in odoosequence number in odoosequence number in odoo 16
PHP - Introduction to File Handling with PHP
PHP -  Introduction to  File Handling with PHPPHP -  Introduction to  File Handling with PHP
PHP - Introduction to File Handling with PHP

This PPT gives Information about: 1. HTTP Headers, 2. Page Redirect, 3. File Uploading 4. File Downloading

php course materialpage redirectprofessional php trainer
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYAPYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA

Classes and Object-oriented Programming: Classes: Creating a Class, The Self Variable, Constructor, Types of Variables, Namespaces, Types of Methods (Instance Methods, Class Methods, Static Methods), Passing Members of One Class to Another Class, Inner Classes Inheritance and Polymorphism: Constructors in Inheritance, Overriding Super Class Constructors and Methods, The super() Method, Types of Inheritance, Single Inheritance, Multiple Inheritance, Method Resolution Order (MRO), Polymorphism, Duck Typing Philosophy of Python, Operator Overloading, Method Overloading, Method Overriding Abstract Classes and Interfaces: Abstract Method and Abstract Class, Interfaces in Python, Abstract Classes vs. Interfaces,

classes and object-oriented programming: classethe self variableconstructor
For Example :
In odoo Invoicing module __manifest__.py they using post init hook
For auto installing l10n module
Refer this link for more:
https://www.cybrosys.com/blog/pre-post-hooks-odoo
Thank You !
Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park,
Kakkancherry,
Calicut University P.O.
Calicut
Kerala, India - 673635.
Cybrosys Ltd
15, ST Antonys Road,
Forest Gate, London
England,
E79QA.
Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, Kerala,
India-682030.

More Related Content

What's hot

View Inheritance in Odoo 15
View Inheritance in Odoo 15View Inheritance in Odoo 15
View Inheritance in Odoo 15
Celine George
 
Odoo (Build module, Security, ORM)
Odoo (Build module, Security, ORM)Odoo (Build module, Security, ORM)
Odoo (Build module, Security, ORM)
sroo galal
 
HOW TO CREATE A MODULE IN ODOO
HOW TO CREATE A MODULE IN ODOOHOW TO CREATE A MODULE IN ODOO
HOW TO CREATE A MODULE IN ODOO
Celine George
 
Odoo - Smart buttons
Odoo - Smart buttonsOdoo - Smart buttons
Odoo - Smart buttons
Odoo
 
View Inheritance in Odoo 16
View Inheritance in Odoo 16View Inheritance in Odoo 16
View Inheritance in Odoo 16
Celine George
 
Working with arrays in php
Working with arrays in phpWorking with arrays in php
Working with arrays in php
Kamal Acharya
 
How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15
Celine George
 
How to Build Custom Module in Odoo 15
How to Build Custom Module in Odoo 15How to Build Custom Module in Odoo 15
How to Build Custom Module in Odoo 15
Celine George
 
Odoo ORM Methods | Object Relational Mapping in Odoo15
Odoo ORM Methods | Object Relational Mapping in Odoo15 Odoo ORM Methods | Object Relational Mapping in Odoo15
Odoo ORM Methods | Object Relational Mapping in Odoo15
Celine George
 
GET and POST in PHP
GET and POST in PHPGET and POST in PHP
GET and POST in PHP
Vineet Kumar Saini
 
What is Delegation Inheritance in Odoo 15
What is Delegation Inheritance in Odoo 15What is Delegation Inheritance in Odoo 15
What is Delegation Inheritance in Odoo 15
Celine George
 
Security: Odoo Code Hardening
Security: Odoo Code HardeningSecurity: Odoo Code Hardening
Security: Odoo Code Hardening
Odoo
 
How to Make Sequence Number in Odoo 16
How to Make Sequence Number in Odoo 16How to Make Sequence Number in Odoo 16
How to Make Sequence Number in Odoo 16
Celine George
 
PHP - Introduction to File Handling with PHP
PHP -  Introduction to  File Handling with PHPPHP -  Introduction to  File Handling with PHP
PHP - Introduction to File Handling with PHP
Vibrant Technologies & Computers
 
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYAPYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
Maulik Borsaniya
 
Odoo Website - How to Develop Building Blocks
Odoo Website - How to Develop Building BlocksOdoo Website - How to Develop Building Blocks
Odoo Website - How to Develop Building Blocks
Odoo
 
Sessions in php
Sessions in php Sessions in php
Sessions in php
Mudasir Syed
 
Html Form Controls
Html Form ControlsHtml Form Controls
introduction to jsrsasign
introduction to jsrsasignintroduction to jsrsasign
introduction to jsrsasign
Kenji Urushima
 
How to Define One2Many Field in Odoo 15
 How to Define One2Many Field in Odoo 15 How to Define One2Many Field in Odoo 15
How to Define One2Many Field in Odoo 15
Celine George
 

What's hot (20)

View Inheritance in Odoo 15
View Inheritance in Odoo 15View Inheritance in Odoo 15
View Inheritance in Odoo 15
 
Odoo (Build module, Security, ORM)
Odoo (Build module, Security, ORM)Odoo (Build module, Security, ORM)
Odoo (Build module, Security, ORM)
 
HOW TO CREATE A MODULE IN ODOO
HOW TO CREATE A MODULE IN ODOOHOW TO CREATE A MODULE IN ODOO
HOW TO CREATE A MODULE IN ODOO
 
Odoo - Smart buttons
Odoo - Smart buttonsOdoo - Smart buttons
Odoo - Smart buttons
 
View Inheritance in Odoo 16
View Inheritance in Odoo 16View Inheritance in Odoo 16
View Inheritance in Odoo 16
 
Working with arrays in php
Working with arrays in phpWorking with arrays in php
Working with arrays in php
 
How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15
 
How to Build Custom Module in Odoo 15
How to Build Custom Module in Odoo 15How to Build Custom Module in Odoo 15
How to Build Custom Module in Odoo 15
 
Odoo ORM Methods | Object Relational Mapping in Odoo15
Odoo ORM Methods | Object Relational Mapping in Odoo15 Odoo ORM Methods | Object Relational Mapping in Odoo15
Odoo ORM Methods | Object Relational Mapping in Odoo15
 
GET and POST in PHP
GET and POST in PHPGET and POST in PHP
GET and POST in PHP
 
What is Delegation Inheritance in Odoo 15
What is Delegation Inheritance in Odoo 15What is Delegation Inheritance in Odoo 15
What is Delegation Inheritance in Odoo 15
 
Security: Odoo Code Hardening
Security: Odoo Code HardeningSecurity: Odoo Code Hardening
Security: Odoo Code Hardening
 
How to Make Sequence Number in Odoo 16
How to Make Sequence Number in Odoo 16How to Make Sequence Number in Odoo 16
How to Make Sequence Number in Odoo 16
 
PHP - Introduction to File Handling with PHP
PHP -  Introduction to  File Handling with PHPPHP -  Introduction to  File Handling with PHP
PHP - Introduction to File Handling with PHP
 
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYAPYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
 
Odoo Website - How to Develop Building Blocks
Odoo Website - How to Develop Building BlocksOdoo Website - How to Develop Building Blocks
Odoo Website - How to Develop Building Blocks
 
Sessions in php
Sessions in php Sessions in php
Sessions in php
 
Html Form Controls
Html Form ControlsHtml Form Controls
Html Form Controls
 
introduction to jsrsasign
introduction to jsrsasignintroduction to jsrsasign
introduction to jsrsasign
 
How to Define One2Many Field in Odoo 15
 How to Define One2Many Field in Odoo 15 How to Define One2Many Field in Odoo 15
How to Define One2Many Field in Odoo 15
 

Similar to External dependencies ,pre init hook & post init hook in odoo

How to Build a Module in Odoo 15 Scaffold Method
How to Build a Module in Odoo 15 Scaffold MethodHow to Build a Module in Odoo 15 Scaffold Method
How to Build a Module in Odoo 15 Scaffold Method
Celine George
 
Odoo 15 Composition of Module
Odoo 15 Composition of ModuleOdoo 15 Composition of Module
Odoo 15 Composition of Module
Celine George
 
Post init hook in the odoo 17 ERP Module
Post init hook in the  odoo 17 ERP ModulePost init hook in the  odoo 17 ERP Module
Post init hook in the odoo 17 ERP Module
Celine George
 
Module Structure in Odoo 15
Module Structure in Odoo 15Module Structure in Odoo 15
Module Structure in Odoo 15
Celine George
 
How to Start Developing Modules in Odoo.pdf
How to Start Developing Modules in Odoo.pdfHow to Start Developing Modules in Odoo.pdf
How to Start Developing Modules in Odoo.pdf
Lisa Brown
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
Mage Guru
 
How to Create Manifest File in Odoo 17 ERP
How to Create Manifest File in Odoo 17 ERPHow to Create Manifest File in Odoo 17 ERP
How to Create Manifest File in Odoo 17 ERP
Celine George
 
Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4
openerpwiki
 
OpenERP Technical Memento
OpenERP Technical MementoOpenERP Technical Memento
OpenERP Technical Memento
Odoo
 
How to configure PyCharm for Odoo development in Windows?
How to configure PyCharm for Odoo development in Windows?How to configure PyCharm for Odoo development in Windows?
How to configure PyCharm for Odoo development in Windows?
Celine George
 
Django by rj
Django by rjDjango by rj
Building a Module in Odoo 16
Building a Module in Odoo 16Building a Module in Odoo 16
Building a Module in Odoo 16
Celine George
 
AtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMSAtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMS
NITSAN Technologies Pvt Ltd
 
Robot framework
Robot frameworkRobot framework
Robot framework
Rochak Bhalla
 
Installation of Odoo 16 on Ubuntu 20.04 LTS | Cybrosys
Installation of Odoo 16 on Ubuntu 20.04 LTS | CybrosysInstallation of Odoo 16 on Ubuntu 20.04 LTS | Cybrosys
Installation of Odoo 16 on Ubuntu 20.04 LTS | Cybrosys
Celine George
 
OpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonOpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in Python
CodeOps Technologies LLP
 
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityExpanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Teamstudio
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
Eran Shlomo
 
Pyramid Framework
Pyramid FrameworkPyramid Framework
Pyramid Framework
Anatoly Bubenkov
 
DJango
DJangoDJango
DJango
Sunil OS
 

Similar to External dependencies ,pre init hook & post init hook in odoo (20)

How to Build a Module in Odoo 15 Scaffold Method
How to Build a Module in Odoo 15 Scaffold MethodHow to Build a Module in Odoo 15 Scaffold Method
How to Build a Module in Odoo 15 Scaffold Method
 
Odoo 15 Composition of Module
Odoo 15 Composition of ModuleOdoo 15 Composition of Module
Odoo 15 Composition of Module
 
Post init hook in the odoo 17 ERP Module
Post init hook in the  odoo 17 ERP ModulePost init hook in the  odoo 17 ERP Module
Post init hook in the odoo 17 ERP Module
 
Module Structure in Odoo 15
Module Structure in Odoo 15Module Structure in Odoo 15
Module Structure in Odoo 15
 
How to Start Developing Modules in Odoo.pdf
How to Start Developing Modules in Odoo.pdfHow to Start Developing Modules in Odoo.pdf
How to Start Developing Modules in Odoo.pdf
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
How to Create Manifest File in Odoo 17 ERP
How to Create Manifest File in Odoo 17 ERPHow to Create Manifest File in Odoo 17 ERP
How to Create Manifest File in Odoo 17 ERP
 
Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4
 
OpenERP Technical Memento
OpenERP Technical MementoOpenERP Technical Memento
OpenERP Technical Memento
 
How to configure PyCharm for Odoo development in Windows?
How to configure PyCharm for Odoo development in Windows?How to configure PyCharm for Odoo development in Windows?
How to configure PyCharm for Odoo development in Windows?
 
Django by rj
Django by rjDjango by rj
Django by rj
 
Building a Module in Odoo 16
Building a Module in Odoo 16Building a Module in Odoo 16
Building a Module in Odoo 16
 
AtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMSAtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMS
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Installation of Odoo 16 on Ubuntu 20.04 LTS | Cybrosys
Installation of Odoo 16 on Ubuntu 20.04 LTS | CybrosysInstallation of Odoo 16 on Ubuntu 20.04 LTS | Cybrosys
Installation of Odoo 16 on Ubuntu 20.04 LTS | Cybrosys
 
OpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonOpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in Python
 
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityExpanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate Usability
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
Pyramid Framework
Pyramid FrameworkPyramid Framework
Pyramid Framework
 
DJango
DJangoDJango
DJango
 

More from Celine George

How to Manage Line Discount in Odoo 17 POS
How to Manage Line Discount in Odoo 17 POSHow to Manage Line Discount in Odoo 17 POS
How to Manage Line Discount in Odoo 17 POS
Celine George
 
How to Manage Access Rights & User Types in Odoo 17
How to Manage Access Rights & User Types in Odoo 17How to Manage Access Rights & User Types in Odoo 17
How to Manage Access Rights & User Types in Odoo 17
Celine George
 
How to Manage Shipping Connectors & Shipping Methods in Odoo 17
How to Manage Shipping Connectors & Shipping Methods in Odoo 17How to Manage Shipping Connectors & Shipping Methods in Odoo 17
How to Manage Shipping Connectors & Shipping Methods in Odoo 17
Celine George
 
How to Empty a One2Many Field in Odoo 17
How to Empty a One2Many Field in Odoo 17How to Empty a One2Many Field in Odoo 17
How to Empty a One2Many Field in Odoo 17
Celine George
 
New Features in Odoo 17 Sign - Odoo 17 Slides
New Features in Odoo 17 Sign - Odoo 17 SlidesNew Features in Odoo 17 Sign - Odoo 17 Slides
New Features in Odoo 17 Sign - Odoo 17 Slides
Celine George
 
How to Manage Early Receipt Printing in Odoo 17 POS
How to Manage Early Receipt Printing in Odoo 17 POSHow to Manage Early Receipt Printing in Odoo 17 POS
How to Manage Early Receipt Printing in Odoo 17 POS
Celine George
 
What is Rescue Session in Odoo 17 POS - Odoo 17 Slides
What is Rescue Session in Odoo 17 POS - Odoo 17 SlidesWhat is Rescue Session in Odoo 17 POS - Odoo 17 Slides
What is Rescue Session in Odoo 17 POS - Odoo 17 Slides
Celine George
 
How to Add a Filter in the Odoo 17 - Odoo 17 Slides
How to Add a Filter in the Odoo 17 - Odoo 17 SlidesHow to Add a Filter in the Odoo 17 - Odoo 17 Slides
How to Add a Filter in the Odoo 17 - Odoo 17 Slides
Celine George
 
How to Create & Publish a Blog in Odoo 17 Website
How to Create & Publish a Blog in Odoo 17 WebsiteHow to Create & Publish a Blog in Odoo 17 Website
How to Create & Publish a Blog in Odoo 17 Website
Celine George
 
How To Update One2many Field From OnChange of Field in Odoo 17
How To Update One2many Field From OnChange of Field in Odoo 17How To Update One2many Field From OnChange of Field in Odoo 17
How To Update One2many Field From OnChange of Field in Odoo 17
Celine George
 
How to Manage Large Scrollbar in Odoo 17 POS
How to Manage Large Scrollbar in Odoo 17 POSHow to Manage Large Scrollbar in Odoo 17 POS
How to Manage Large Scrollbar in Odoo 17 POS
Celine George
 
How to Create a New Article in Knowledge App in Odoo 17
How to Create a New Article in Knowledge App in Odoo 17How to Create a New Article in Knowledge App in Odoo 17
How to Create a New Article in Knowledge App in Odoo 17
Celine George
 
Odoo 17 Social Marketing - Lead Generation On Facebook
Odoo 17 Social Marketing - Lead Generation On FacebookOdoo 17 Social Marketing - Lead Generation On Facebook
Odoo 17 Social Marketing - Lead Generation On Facebook
Celine George
 
What is Packaging of Products in Odoo 17
What is Packaging of Products in Odoo 17What is Packaging of Products in Odoo 17
What is Packaging of Products in Odoo 17
Celine George
 
How To Create a Transient Model in Odoo 17
How To Create a Transient Model in Odoo 17How To Create a Transient Model in Odoo 17
How To Create a Transient Model in Odoo 17
Celine George
 
How to Create Sequence Numbers in Odoo 17
How to Create Sequence Numbers in Odoo 17How to Create Sequence Numbers in Odoo 17
How to Create Sequence Numbers in Odoo 17
Celine George
 
How to Handle the Separate Discount Account on Invoice in Odoo 17
How to Handle the Separate Discount Account on Invoice in Odoo 17How to Handle the Separate Discount Account on Invoice in Odoo 17
How to Handle the Separate Discount Account on Invoice in Odoo 17
Celine George
 
Year-to-Date Filter in Odoo 17 Dashboard
Year-to-Date Filter in Odoo 17 DashboardYear-to-Date Filter in Odoo 17 Dashboard
Year-to-Date Filter in Odoo 17 Dashboard
Celine George
 
What is Blank dashboards in the odoo 17 ERP
What is Blank dashboards in the odoo 17 ERPWhat is Blank dashboards in the odoo 17 ERP
What is Blank dashboards in the odoo 17 ERP
Celine George
 
Views in Odoo - Advanced Views - Pivot View in Odoo 17
Views in Odoo - Advanced Views - Pivot View in Odoo 17Views in Odoo - Advanced Views - Pivot View in Odoo 17
Views in Odoo - Advanced Views - Pivot View in Odoo 17
Celine George
 

More from Celine George (20)

How to Manage Line Discount in Odoo 17 POS
How to Manage Line Discount in Odoo 17 POSHow to Manage Line Discount in Odoo 17 POS
How to Manage Line Discount in Odoo 17 POS
 
How to Manage Access Rights & User Types in Odoo 17
How to Manage Access Rights & User Types in Odoo 17How to Manage Access Rights & User Types in Odoo 17
How to Manage Access Rights & User Types in Odoo 17
 
How to Manage Shipping Connectors & Shipping Methods in Odoo 17
How to Manage Shipping Connectors & Shipping Methods in Odoo 17How to Manage Shipping Connectors & Shipping Methods in Odoo 17
How to Manage Shipping Connectors & Shipping Methods in Odoo 17
 
How to Empty a One2Many Field in Odoo 17
How to Empty a One2Many Field in Odoo 17How to Empty a One2Many Field in Odoo 17
How to Empty a One2Many Field in Odoo 17
 
New Features in Odoo 17 Sign - Odoo 17 Slides
New Features in Odoo 17 Sign - Odoo 17 SlidesNew Features in Odoo 17 Sign - Odoo 17 Slides
New Features in Odoo 17 Sign - Odoo 17 Slides
 
How to Manage Early Receipt Printing in Odoo 17 POS
How to Manage Early Receipt Printing in Odoo 17 POSHow to Manage Early Receipt Printing in Odoo 17 POS
How to Manage Early Receipt Printing in Odoo 17 POS
 
What is Rescue Session in Odoo 17 POS - Odoo 17 Slides
What is Rescue Session in Odoo 17 POS - Odoo 17 SlidesWhat is Rescue Session in Odoo 17 POS - Odoo 17 Slides
What is Rescue Session in Odoo 17 POS - Odoo 17 Slides
 
How to Add a Filter in the Odoo 17 - Odoo 17 Slides
How to Add a Filter in the Odoo 17 - Odoo 17 SlidesHow to Add a Filter in the Odoo 17 - Odoo 17 Slides
How to Add a Filter in the Odoo 17 - Odoo 17 Slides
 
How to Create & Publish a Blog in Odoo 17 Website
How to Create & Publish a Blog in Odoo 17 WebsiteHow to Create & Publish a Blog in Odoo 17 Website
How to Create & Publish a Blog in Odoo 17 Website
 
How To Update One2many Field From OnChange of Field in Odoo 17
How To Update One2many Field From OnChange of Field in Odoo 17How To Update One2many Field From OnChange of Field in Odoo 17
How To Update One2many Field From OnChange of Field in Odoo 17
 
How to Manage Large Scrollbar in Odoo 17 POS
How to Manage Large Scrollbar in Odoo 17 POSHow to Manage Large Scrollbar in Odoo 17 POS
How to Manage Large Scrollbar in Odoo 17 POS
 
How to Create a New Article in Knowledge App in Odoo 17
How to Create a New Article in Knowledge App in Odoo 17How to Create a New Article in Knowledge App in Odoo 17
How to Create a New Article in Knowledge App in Odoo 17
 
Odoo 17 Social Marketing - Lead Generation On Facebook
Odoo 17 Social Marketing - Lead Generation On FacebookOdoo 17 Social Marketing - Lead Generation On Facebook
Odoo 17 Social Marketing - Lead Generation On Facebook
 
What is Packaging of Products in Odoo 17
What is Packaging of Products in Odoo 17What is Packaging of Products in Odoo 17
What is Packaging of Products in Odoo 17
 
How To Create a Transient Model in Odoo 17
How To Create a Transient Model in Odoo 17How To Create a Transient Model in Odoo 17
How To Create a Transient Model in Odoo 17
 
How to Create Sequence Numbers in Odoo 17
How to Create Sequence Numbers in Odoo 17How to Create Sequence Numbers in Odoo 17
How to Create Sequence Numbers in Odoo 17
 
How to Handle the Separate Discount Account on Invoice in Odoo 17
How to Handle the Separate Discount Account on Invoice in Odoo 17How to Handle the Separate Discount Account on Invoice in Odoo 17
How to Handle the Separate Discount Account on Invoice in Odoo 17
 
Year-to-Date Filter in Odoo 17 Dashboard
Year-to-Date Filter in Odoo 17 DashboardYear-to-Date Filter in Odoo 17 Dashboard
Year-to-Date Filter in Odoo 17 Dashboard
 
What is Blank dashboards in the odoo 17 ERP
What is Blank dashboards in the odoo 17 ERPWhat is Blank dashboards in the odoo 17 ERP
What is Blank dashboards in the odoo 17 ERP
 
Views in Odoo - Advanced Views - Pivot View in Odoo 17
Views in Odoo - Advanced Views - Pivot View in Odoo 17Views in Odoo - Advanced Views - Pivot View in Odoo 17
Views in Odoo - Advanced Views - Pivot View in Odoo 17
 

Recently uploaded

Business model Lean format - sample Feb23.pdf
Business model Lean format - sample Feb23.pdfBusiness model Lean format - sample Feb23.pdf
Business model Lean format - sample Feb23.pdf
Thales Jacobi
 
BeMetals Presentation_July 2 2024 .pdf
BeMetals Presentation_July 2 2024    .pdfBeMetals Presentation_July 2 2024    .pdf
BeMetals Presentation_July 2 2024 .pdf
DerekIwanaka1
 
DEKISH ELEVATOR INDIA PVT LTD Brochure.pdf
DEKISH ELEVATOR INDIA PVT LTD Brochure.pdfDEKISH ELEVATOR INDIA PVT LTD Brochure.pdf
DEKISH ELEVATOR INDIA PVT LTD Brochure.pdf
unosafeads
 
Local SEO Strategies: Dominate Local Search with Effective SEO Tactics
Local SEO Strategies: Dominate Local Search with Effective SEO TacticsLocal SEO Strategies: Dominate Local Search with Effective SEO Tactics
Local SEO Strategies: Dominate Local Search with Effective SEO Tactics
Woospers
 
Cheslyn Jacobs- TymeBank: Building Consumer Trust in Digital Banking
Cheslyn Jacobs- TymeBank: Building Consumer Trust in Digital  BankingCheslyn Jacobs- TymeBank: Building Consumer Trust in Digital  Banking
Cheslyn Jacobs- TymeBank: Building Consumer Trust in Digital Banking
itnewsafrica
 
PETAVIT MICHAEL TAY.pdfAAAAAAAAAAAAAAAAAAAA
PETAVIT MICHAEL TAY.pdfAAAAAAAAAAAAAAAAAAAAPETAVIT MICHAEL TAY.pdfAAAAAAAAAAAAAAAAAAAA
PETAVIT MICHAEL TAY.pdfAAAAAAAAAAAAAAAAAAAA
lawrenceads01
 
Destor.one - One Pager for Investment Round Dec22.pdf
Destor.one - One Pager for Investment Round Dec22.pdfDestor.one - One Pager for Investment Round Dec22.pdf
Destor.one - One Pager for Investment Round Dec22.pdf
Thales Jacobi
 
Kalyan Panel Chart | 9037164122 | kalyanchart.net
Kalyan Panel Chart | 9037164122 | kalyanchart.netKalyan Panel Chart | 9037164122 | kalyanchart.net
Kalyan Panel Chart | 9037164122 | kalyanchart.net
kalyan chart
 
The AI-Powered Side Hustle Transforming Lives: A Dad's Journey to Financial S...
The AI-Powered Side Hustle Transforming Lives: A Dad's Journey to Financial S...The AI-Powered Side Hustle Transforming Lives: A Dad's Journey to Financial S...
The AI-Powered Side Hustle Transforming Lives: A Dad's Journey to Financial S...
SOFTTECHHUB
 
IncomeTax Compliance Duedates- July 2024
IncomeTax Compliance Duedates- July 2024IncomeTax Compliance Duedates- July 2024
IncomeTax Compliance Duedates- July 2024
EbizfilingIndia
 
Destor.One - Business Presentation Dec22.pdf
Destor.One - Business Presentation Dec22.pdfDestor.One - Business Presentation Dec22.pdf
Destor.One - Business Presentation Dec22.pdf
Thales Jacobi
 
PETAVIT SIP-05.pdfAAAAAAAAAAAAAAAAAAAAAAAAA
PETAVIT SIP-05.pdfAAAAAAAAAAAAAAAAAAAAAAAAAPETAVIT SIP-05.pdfAAAAAAAAAAAAAAAAAAAAAAAAA
PETAVIT SIP-05.pdfAAAAAAAAAAAAAAAAAAAAAAAAA
lawrenceads01
 
Christmas Decorations_ A Guide to Small Christmas Trees, Candle Centerpieces,...
Christmas Decorations_ A Guide to Small Christmas Trees, Candle Centerpieces,...Christmas Decorations_ A Guide to Small Christmas Trees, Candle Centerpieces,...
Christmas Decorations_ A Guide to Small Christmas Trees, Candle Centerpieces,...
Lynch Creek Farm
 
حبوب سايتوتك للبيع في الامارات اشراف دكتورة 00966583759617
حبوب سايتوتك للبيع في الامارات اشراف دكتورة 00966583759617حبوب سايتوتك للبيع في الامارات اشراف دكتورة 00966583759617
حبوب سايتوتك للبيع في الامارات اشراف دكتورة 00966583759617
حبوب الاجهاض سايتوتك للبيع في الامارات cytotec واتس 00966583759617
 
The Strengths and Weaknesses of Each Zodiac Sign
The Strengths and Weaknesses of Each Zodiac SignThe Strengths and Weaknesses of Each Zodiac Sign
The Strengths and Weaknesses of Each Zodiac Sign
my Pandit
 
Cryptocurrency KYC Policies: Comparing Binance KYC Bypass with Rivals
Cryptocurrency KYC Policies: Comparing Binance KYC Bypass with RivalsCryptocurrency KYC Policies: Comparing Binance KYC Bypass with Rivals
Cryptocurrency KYC Policies: Comparing Binance KYC Bypass with Rivals
Any kyc Account
 
ConvertKit: Best Email Marketing Tool for 2024
ConvertKit: Best Email Marketing Tool for 2024ConvertKit: Best Email Marketing Tool for 2024
ConvertKit: Best Email Marketing Tool for 2024
Rakesh Jalan
 
Satta matka guessing Kalyan result sattamatka
Satta matka guessing Kalyan result sattamatkaSatta matka guessing Kalyan result sattamatka
Satta matka guessing Kalyan result sattamatka
➑➌➋➑➒➎➑➑➊➍
 
How AI is Disrupting Service Industry More Than Design Thinking
How AI is Disrupting Service Industry More Than Design ThinkingHow AI is Disrupting Service Industry More Than Design Thinking
How AI is Disrupting Service Industry More Than Design Thinking
Body of Knowledge
 
Transforming the Future of Limo Services.pptx
Transforming the Future of Limo Services.pptxTransforming the Future of Limo Services.pptx
Transforming the Future of Limo Services.pptx
limocaptaincom
 

Recently uploaded (20)

Business model Lean format - sample Feb23.pdf
Business model Lean format - sample Feb23.pdfBusiness model Lean format - sample Feb23.pdf
Business model Lean format - sample Feb23.pdf
 
BeMetals Presentation_July 2 2024 .pdf
BeMetals Presentation_July 2 2024    .pdfBeMetals Presentation_July 2 2024    .pdf
BeMetals Presentation_July 2 2024 .pdf
 
DEKISH ELEVATOR INDIA PVT LTD Brochure.pdf
DEKISH ELEVATOR INDIA PVT LTD Brochure.pdfDEKISH ELEVATOR INDIA PVT LTD Brochure.pdf
DEKISH ELEVATOR INDIA PVT LTD Brochure.pdf
 
Local SEO Strategies: Dominate Local Search with Effective SEO Tactics
Local SEO Strategies: Dominate Local Search with Effective SEO TacticsLocal SEO Strategies: Dominate Local Search with Effective SEO Tactics
Local SEO Strategies: Dominate Local Search with Effective SEO Tactics
 
Cheslyn Jacobs- TymeBank: Building Consumer Trust in Digital Banking
Cheslyn Jacobs- TymeBank: Building Consumer Trust in Digital  BankingCheslyn Jacobs- TymeBank: Building Consumer Trust in Digital  Banking
Cheslyn Jacobs- TymeBank: Building Consumer Trust in Digital Banking
 
PETAVIT MICHAEL TAY.pdfAAAAAAAAAAAAAAAAAAAA
PETAVIT MICHAEL TAY.pdfAAAAAAAAAAAAAAAAAAAAPETAVIT MICHAEL TAY.pdfAAAAAAAAAAAAAAAAAAAA
PETAVIT MICHAEL TAY.pdfAAAAAAAAAAAAAAAAAAAA
 
Destor.one - One Pager for Investment Round Dec22.pdf
Destor.one - One Pager for Investment Round Dec22.pdfDestor.one - One Pager for Investment Round Dec22.pdf
Destor.one - One Pager for Investment Round Dec22.pdf
 
Kalyan Panel Chart | 9037164122 | kalyanchart.net
Kalyan Panel Chart | 9037164122 | kalyanchart.netKalyan Panel Chart | 9037164122 | kalyanchart.net
Kalyan Panel Chart | 9037164122 | kalyanchart.net
 
The AI-Powered Side Hustle Transforming Lives: A Dad's Journey to Financial S...
The AI-Powered Side Hustle Transforming Lives: A Dad's Journey to Financial S...The AI-Powered Side Hustle Transforming Lives: A Dad's Journey to Financial S...
The AI-Powered Side Hustle Transforming Lives: A Dad's Journey to Financial S...
 
IncomeTax Compliance Duedates- July 2024
IncomeTax Compliance Duedates- July 2024IncomeTax Compliance Duedates- July 2024
IncomeTax Compliance Duedates- July 2024
 
Destor.One - Business Presentation Dec22.pdf
Destor.One - Business Presentation Dec22.pdfDestor.One - Business Presentation Dec22.pdf
Destor.One - Business Presentation Dec22.pdf
 
PETAVIT SIP-05.pdfAAAAAAAAAAAAAAAAAAAAAAAAA
PETAVIT SIP-05.pdfAAAAAAAAAAAAAAAAAAAAAAAAAPETAVIT SIP-05.pdfAAAAAAAAAAAAAAAAAAAAAAAAA
PETAVIT SIP-05.pdfAAAAAAAAAAAAAAAAAAAAAAAAA
 
Christmas Decorations_ A Guide to Small Christmas Trees, Candle Centerpieces,...
Christmas Decorations_ A Guide to Small Christmas Trees, Candle Centerpieces,...Christmas Decorations_ A Guide to Small Christmas Trees, Candle Centerpieces,...
Christmas Decorations_ A Guide to Small Christmas Trees, Candle Centerpieces,...
 
حبوب سايتوتك للبيع في الامارات اشراف دكتورة 00966583759617
حبوب سايتوتك للبيع في الامارات اشراف دكتورة 00966583759617حبوب سايتوتك للبيع في الامارات اشراف دكتورة 00966583759617
حبوب سايتوتك للبيع في الامارات اشراف دكتورة 00966583759617
 
The Strengths and Weaknesses of Each Zodiac Sign
The Strengths and Weaknesses of Each Zodiac SignThe Strengths and Weaknesses of Each Zodiac Sign
The Strengths and Weaknesses of Each Zodiac Sign
 
Cryptocurrency KYC Policies: Comparing Binance KYC Bypass with Rivals
Cryptocurrency KYC Policies: Comparing Binance KYC Bypass with RivalsCryptocurrency KYC Policies: Comparing Binance KYC Bypass with Rivals
Cryptocurrency KYC Policies: Comparing Binance KYC Bypass with Rivals
 
ConvertKit: Best Email Marketing Tool for 2024
ConvertKit: Best Email Marketing Tool for 2024ConvertKit: Best Email Marketing Tool for 2024
ConvertKit: Best Email Marketing Tool for 2024
 
Satta matka guessing Kalyan result sattamatka
Satta matka guessing Kalyan result sattamatkaSatta matka guessing Kalyan result sattamatka
Satta matka guessing Kalyan result sattamatka
 
How AI is Disrupting Service Industry More Than Design Thinking
How AI is Disrupting Service Industry More Than Design ThinkingHow AI is Disrupting Service Industry More Than Design Thinking
How AI is Disrupting Service Industry More Than Design Thinking
 
Transforming the Future of Limo Services.pptx
Transforming the Future of Limo Services.pptxTransforming the Future of Limo Services.pptx
Transforming the Future of Limo Services.pptx
 

External dependencies ,pre init hook & post init hook in odoo

  • 1. www.cybrosys.com External Dependencies ,Pre Init Hook & Post Init Hook In Odoo
  • 2. INTRODUCTION When we creating a module in odoo important thing is __manifest__.py( for odoo 10.0 and later versions) or __openerp__.py(for odoo 9.0 and earlier versions).
  • 3. In manifest file, we can define 1) name (str, required):- Human readable name of the module(other than technical name) 2) version(str) :- Module version(should follow version rules). 3) summary(str):- Short description of the module. 4) description (str):-Extended description for the module.
  • 4. 5) Author (str):- Module author’s name. 6) Website (str):- Module author’s website URL. 7) License (str, defaults: AGPL-3):- Distribution license for the module. 8) Category (str, default: Uncategorized) :- Classification category within Odoo.
  • 5. 9) depends (list(str)):- Depended on odoo modules which must be loaded before the module. 10) Data (list(str)):- Path of all data files from the root directory which must always be installed or updated with the module. 11) Demo (list(str)):- Path of all demo data files which are only installed or updated in demonstration mode. 12) auto_install (bool, default: False):- If True, the module will automatically be installed if all dependent modules are installed.
  • 6. Except for those keys in odoo __manifest__.py we have some special keys for module compatibility check, adding required dependencies and for running scripts during module installation. Those keys are -pre_init_hook -External_dependencies -post _init_hook
  • 7. External dependency In __manifest__.py file external_dependency key is used for declaring all external libraries (python packages or any binaries) that have to be installed to make the module work. External dependencies are defined in __manifest__.py file under external dependency key like below
  • 8. Check if some system application exists:
  • 9. If someone created a module in odoo, which uses Python modules for its working. So at the time of module installation if the system does not find Python packages or any binaries defined in __maifest__.py installed in the system, it will raise an error and not allow to install the module.
  • 10. For example: In Odoo's ‘Weighing Scale Hardware Driver’ module’s __manifest__.py file there is a line
  • 11. • For defining python dependency file ‘scale’ for the module ‘Weighing Scale Hardware Driver’, and this module allows the point of sale to connect to a scale using a USB HSM serial scale interface such as Mettler Toledo Ariva. • The module requires Python dependency of ‘scale’ library, so in the module they use external_dependencies’. • So at the time of module installation, if the system does not find ‘scale’ library installed, it will raise an error and not allow to install the module.
  • 12. Pre Init Hook: • The ‘pre_init_hook‘ is also a special key available in __manifest__.py. • During installation, when the user clicks to install the custom module, it will call a Pre- installation hook and do some initialization, copying of files or other and then after that once it finished, we can capture the return installation process of Odoo and run a Post- installation hook.
  • 13. • The pre init hook is called with a database cursor and may perform modifications in the database to prepare for the module installation. • You can use pre_init_hook’ before registering the module's logic in the ir.module.module. It is commonly used for modules compatibility check.
  • 14. For using the pre_init_hook define this key in your __manifest__.py and assigning it’s a method created in your __init_.py of the module(Value of the key is the name of a Python function which must be defined in __init__.py).
  • 15. For Example : As many times we also have validated that the module build for Odoo 8 should not be installed in Odoo 9 in that case we use pre_init_hook .
  • 16. Post Init Hook: • The post init hook is called with a database cursor and registry object and may perform modifications in the database to finalize the module installation. • We can define the ‘post_init_hook‘ in the same ways as pre init hook.
  • 17. For Example : In odoo Invoicing module __manifest__.py they using post init hook For auto installing l10n module
  • 18. Refer this link for more: https://www.cybrosys.com/blog/pre-post-hooks-odoo
  • 19. Thank You ! Cybrosys Technologies Pvt. Ltd. Neospace, Kinfra Techno Park, Kakkancherry, Calicut University P.O. Calicut Kerala, India - 673635. Cybrosys Ltd 15, ST Antonys Road, Forest Gate, London England, E79QA. Cybrosys Technologies Pvt. Ltd. 1st Floor, Thapasya Building, Infopark, Kakkanad, Kochi, Kerala, India-682030.