SlideShare a Scribd company logo
4
Most read
5
Most read
7
Most read
View Inheritance in Odoo 16
● Views are what defined how records should be displayed to the
end users. They are usually specified in XML.
● We Know Inheritance is the process of adding new features to an
existing model.
● 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.
Lets see how to add a new field date of birth inside the contacts form.
Here inside the contact form i have added a new field date of birth. so let’s see how we can achieve
this.
For that open pycharm. so here i have a custom module named partner_dob.
● Inside the models i have a new python file res_partner in which i have inherited the model
res.partner and added a new field. so for adding a new field first you have to inherit the
corresponding model and then add that particular field.
● We can inherit an existing model by using the keyword _inherit = "Class_Name". So by
inheriting and adding this field, the newly created dob field will be added to the existing
database table of res.partner.
● Here we have used _inherit=”res.partner”. And added a field dob.
• After that inside the views directory create a new XML file for inheriting the contact form. So
here i have created an xml file for inheriting the view. And inside this create a new record
inside the model ir.ui.view .
● Since we have to inherit an existing record inside the model ir.ui.view, we have to specify the
model as ir.ui.view .
● We have to set an external id for the newly creating record as well.
● Then add the value for the attribute name. so this will be the name for this inherited view.
● Then specify the model as res.partner since we are inheriting an existing view for the model
res.partner.
● Then next field is inherit_id where we have to specify the external id of the view which we are
inheriting.
This inherit_id can be obtained from the user interface. For that go to the contact form since we
are inheriting the contact form.
● If you want to inherit and modify any other view then open the particular view and after
enabling the debug mode go to the developer tools.
● Here we have an option edit view form.
● Click on that so that from here we can get the external id of this particular form view.
● So we have to specify this external id inside the inherit_id attribute. So the external id for the
contact form is base.view_partner_form .
● I have specified the same external id for the attribute inherit_id.
● Then we have to specify the field which we have to add inside this existing view. For that
specify the path using the tag <xpath>
● So I have added a new field after the field vat which is already present in this form.
● So here we can see that the tax id field name is vat so i specified this particular field and gave
the position as after.
● So that the new field dob will be added after this vat field.
The <xpath> attribute ‘position’ has different values:
● inside - appends <xpath> body to the end of the matched element
● replace - replaces the matched element with the <xpath> body
● before - inserts the <xpath> body as a sibling before the matched element
● after - inserts the <xpaths> body as a sibling after the matched element
● attributes - alters the attributes of the matched element using the special attribute elements
in the <xpath> body
● After specifying this record we have to add it inside the manifest.
● So i have added the xml file inside the manifest and then you have to restart the service and
go to apps and you have to search for your custom app.
Check our company website
for related blogs and Odoo book.
Check our YouTube channel for
functional and technical videos in Odoo.

More Related Content

PPTX
How to show warning _ error messages in Odoo 16
Celine George
 
PPTX
Set Default Values to Fields in Odoo 15
Celine George
 
PPTX
Owl: The New Odoo UI Framework
Odoo
 
PPTX
Jdbc
Yamuna Devi
 
PPTX
Getting started with entity framework
Lushanthan Sivaneasharajah
 
PPTX
Mysql creating stored function
Prof.Nilesh Magar
 
PDF
Support de cours Spring M.youssfi
ENSET, Université Hassan II Casablanca
 
How to show warning _ error messages in Odoo 16
Celine George
 
Set Default Values to Fields in Odoo 15
Celine George
 
Owl: The New Odoo UI Framework
Odoo
 
Getting started with entity framework
Lushanthan Sivaneasharajah
 
Mysql creating stored function
Prof.Nilesh Magar
 
Support de cours Spring M.youssfi
ENSET, Université Hassan II Casablanca
 

What's hot (20)

PDF
Introduction à pl/sql
Abdelouahed Abdou
 
PPTX
Basic Views in Odoo 16
Celine George
 
PPTX
Learn How to Manage Storage Locations Odoo 15
Celine George
 
DOCX
QWeb Report in odoo
expertodoo
 
PDF
Présentation de Django @ Orange Labs (FR)
Martin Latrille
 
PPTX
Tutorial: Develop an App with the Odoo Framework
Odoo
 
PPTX
React workshop
Imran Sayed
 
PPTX
How to Define One2Many Field in Odoo 15
Celine George
 
PDF
ES6 presentation
ritika1
 
PPTX
How to Define Many2many Field in Odoo 15
Celine George
 
PPTX
reactJS
Syam Santhosh
 
PPTX
How to Customize POS Receipts in the Odoo 17
Celine George
 
PDF
Object-Oriented Design Heuristics
kim.mens
 
PDF
Flask Introduction - Python Meetup
Areski Belaid
 
PDF
Django Tutorial | Django Web Development With Python | Django Training and Ce...
Edureka!
 
PPT
Reflection in java
upen.rockin
 
PPTX
Workshop spring session 2 - La persistance au sein des applications Java
Antoine Rey
 
PDF
Angular Directives
iFour Technolab Pvt. Ltd.
 
PPTX
XML
marwa baich
 
PPTX
What are Wizards - Defining and Launching in Odoo 15Wizards - Defining and La...
Celine George
 
Introduction à pl/sql
Abdelouahed Abdou
 
Basic Views in Odoo 16
Celine George
 
Learn How to Manage Storage Locations Odoo 15
Celine George
 
QWeb Report in odoo
expertodoo
 
Présentation de Django @ Orange Labs (FR)
Martin Latrille
 
Tutorial: Develop an App with the Odoo Framework
Odoo
 
React workshop
Imran Sayed
 
How to Define One2Many Field in Odoo 15
Celine George
 
ES6 presentation
ritika1
 
How to Define Many2many Field in Odoo 15
Celine George
 
reactJS
Syam Santhosh
 
How to Customize POS Receipts in the Odoo 17
Celine George
 
Object-Oriented Design Heuristics
kim.mens
 
Flask Introduction - Python Meetup
Areski Belaid
 
Django Tutorial | Django Web Development With Python | Django Training and Ce...
Edureka!
 
Reflection in java
upen.rockin
 
Workshop spring session 2 - La persistance au sein des applications Java
Antoine Rey
 
Angular Directives
iFour Technolab Pvt. Ltd.
 
What are Wizards - Defining and Launching in Odoo 15Wizards - Defining and La...
Celine George
 
Ad

Similar to View Inheritance in Odoo 16 (20)

PPTX
View Inheritance in Odoo 17 - Odoo 17 Slides
Celine George
 
PPTX
Replacing a Field in Tree View Odoo 15
Celine George
 
PPTX
How to Add Group by Feature in Portal - Odoo 17 Slides
Celine George
 
PPTX
Objects and classes in Visual Basic
Sangeetha Sg
 
PPTX
How to Create and Manage Wizard in Odoo 17
Celine George
 
PPTX
How to Add a New Field to an Existing Model
Celine George
 
PPTX
Inheritance _ Delegation Inheritance in Odoo 16
Celine George
 
PDF
Function
GauravGautam224100
 
PPTX
How to Build Custom Module in Odoo 15
Celine George
 
DOCX
Cis 407 i lab 6 of 7
helpido9
 
PDF
computer notes - Const keyword
ecomputernotes
 
PPTX
Intro To C++ - Class #19: Functions
Blue Elephant Consulting
 
PPTX
Odoo 15 Composition of Module
Celine George
 
PPTX
How to use noupdate 0 or 1 in Odoo - Odoo 17 Slides
Celine George
 
PPTX
How to use noupdate 0 or 1 in Odoo - Odoo 17 Slides
Celine George
 
PDF
Functions and Arguments in Python
Mars Devs
 
PPTX
How to Build a Module in Odoo 15 Scaffold Method
Celine George
 
PPTX
Onchange
Celine George
 
DOCX
Informatica cloud Powercenter designer
Rameswara Reddy
 
PPTX
Building A Website - URLs and routing
RahulRaj965986
 
View Inheritance in Odoo 17 - Odoo 17 Slides
Celine George
 
Replacing a Field in Tree View Odoo 15
Celine George
 
How to Add Group by Feature in Portal - Odoo 17 Slides
Celine George
 
Objects and classes in Visual Basic
Sangeetha Sg
 
How to Create and Manage Wizard in Odoo 17
Celine George
 
How to Add a New Field to an Existing Model
Celine George
 
Inheritance _ Delegation Inheritance in Odoo 16
Celine George
 
How to Build Custom Module in Odoo 15
Celine George
 
Cis 407 i lab 6 of 7
helpido9
 
computer notes - Const keyword
ecomputernotes
 
Intro To C++ - Class #19: Functions
Blue Elephant Consulting
 
Odoo 15 Composition of Module
Celine George
 
How to use noupdate 0 or 1 in Odoo - Odoo 17 Slides
Celine George
 
How to use noupdate 0 or 1 in Odoo - Odoo 17 Slides
Celine George
 
Functions and Arguments in Python
Mars Devs
 
How to Build a Module in Odoo 15 Scaffold Method
Celine George
 
Onchange
Celine George
 
Informatica cloud Powercenter designer
Rameswara Reddy
 
Building A Website - URLs and routing
RahulRaj965986
 
Ad

More from Celine George (20)

PPTX
How to Manage Referral Reporting in Odoo 18 Referrals
Celine George
 
PPTX
How to Set, Track, & Review Employee Goals in Odoo 18 Appraisals
Celine George
 
PPTX
Revamp in MTO Odoo 18 Inventory - Odoo Slides
Celine George
 
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Manage Bill Control Policy in Odoo 18
Celine George
 
PPTX
How to Manage Loyalty Points in Odoo 18 Sales
Celine George
 
PPTX
Odoo 18 Sales_ Managing Quotation Validity
Celine George
 
PPTX
How to Manage Global Discount in Odoo 18 POS
Celine George
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Manage Resupply Subcontracting in Odoo 18
Celine George
 
PPTX
Qweb Templates and Operations in Odoo 18
Celine George
 
PPTX
Room booking management - Meeting Room In Odoo 17
Celine George
 
PPTX
Folding Off Hours in Gantt View in Odoo 18.2
Celine George
 
How to Manage Referral Reporting in Odoo 18 Referrals
Celine George
 
How to Set, Track, & Review Employee Goals in Odoo 18 Appraisals
Celine George
 
Revamp in MTO Odoo 18 Inventory - Odoo Slides
Celine George
 
How to Manage Starshipit in Odoo 18 - Odoo Slides
Celine George
 
How to Manage Bill Control Policy in Odoo 18
Celine George
 
How to Manage Loyalty Points in Odoo 18 Sales
Celine George
 
Odoo 18 Sales_ Managing Quotation Validity
Celine George
 
How to Manage Global Discount in Odoo 18 POS
Celine George
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
How to Manage Resupply Subcontracting in Odoo 18
Celine George
 
Qweb Templates and Operations in Odoo 18
Celine George
 
Room booking management - Meeting Room In Odoo 17
Celine George
 
Folding Off Hours in Gantt View in Odoo 18.2
Celine George
 

Recently uploaded (20)

PPTX
Skill Development Program For Physiotherapy Students by SRY.pptx
Prof.Dr.Y.SHANTHOSHRAJA MPT Orthopedic., MSc Microbiology
 
PPTX
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PDF
Wings of Fire Book by Dr. A.P.J Abdul Kalam Full PDF
hetalvaishnav93
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PPTX
IMMUNIZATION PROGRAMME pptx
AneetaSharma15
 
PDF
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
Strengthening open access through collaboration: building connections with OP...
Jisc
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PDF
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPTX
Understanding operators in c language.pptx
auteharshil95
 
PDF
5.EXPLORING-FORCES-Detailed-Notes.pdf/8TH CLASS SCIENCE CURIOSITY
Sandeep Swamy
 
PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PPTX
vedic maths in python:unleasing ancient wisdom with modern code
mistrymuskan14
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
Skill Development Program For Physiotherapy Students by SRY.pptx
Prof.Dr.Y.SHANTHOSHRAJA MPT Orthopedic., MSc Microbiology
 
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
Wings of Fire Book by Dr. A.P.J Abdul Kalam Full PDF
hetalvaishnav93
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
IMMUNIZATION PROGRAMME pptx
AneetaSharma15
 
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
Strengthening open access through collaboration: building connections with OP...
Jisc
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
Understanding operators in c language.pptx
auteharshil95
 
5.EXPLORING-FORCES-Detailed-Notes.pdf/8TH CLASS SCIENCE CURIOSITY
Sandeep Swamy
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
vedic maths in python:unleasing ancient wisdom with modern code
mistrymuskan14
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 

View Inheritance in Odoo 16

  • 2. ● Views are what defined how records should be displayed to the end users. They are usually specified in XML. ● We Know Inheritance is the process of adding new features to an existing model. ● 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.
  • 3. Lets see how to add a new field date of birth inside the contacts form.
  • 4. Here inside the contact form i have added a new field date of birth. so let’s see how we can achieve this. For that open pycharm. so here i have a custom module named partner_dob.
  • 5. ● Inside the models i have a new python file res_partner in which i have inherited the model res.partner and added a new field. so for adding a new field first you have to inherit the corresponding model and then add that particular field.
  • 6. ● We can inherit an existing model by using the keyword _inherit = "Class_Name". So by inheriting and adding this field, the newly created dob field will be added to the existing database table of res.partner. ● Here we have used _inherit=”res.partner”. And added a field dob.
  • 7. • After that inside the views directory create a new XML file for inheriting the contact form. So here i have created an xml file for inheriting the view. And inside this create a new record inside the model ir.ui.view .
  • 8. ● Since we have to inherit an existing record inside the model ir.ui.view, we have to specify the model as ir.ui.view . ● We have to set an external id for the newly creating record as well. ● Then add the value for the attribute name. so this will be the name for this inherited view. ● Then specify the model as res.partner since we are inheriting an existing view for the model res.partner. ● Then next field is inherit_id where we have to specify the external id of the view which we are inheriting.
  • 9. This inherit_id can be obtained from the user interface. For that go to the contact form since we are inheriting the contact form.
  • 10. ● If you want to inherit and modify any other view then open the particular view and after enabling the debug mode go to the developer tools. ● Here we have an option edit view form. ● Click on that so that from here we can get the external id of this particular form view. ● So we have to specify this external id inside the inherit_id attribute. So the external id for the contact form is base.view_partner_form . ● I have specified the same external id for the attribute inherit_id.
  • 11. ● Then we have to specify the field which we have to add inside this existing view. For that specify the path using the tag <xpath> ● So I have added a new field after the field vat which is already present in this form. ● So here we can see that the tax id field name is vat so i specified this particular field and gave the position as after. ● So that the new field dob will be added after this vat field.
  • 12. The <xpath> attribute ‘position’ has different values: ● inside - appends <xpath> body to the end of the matched element ● replace - replaces the matched element with the <xpath> body ● before - inserts the <xpath> body as a sibling before the matched element ● after - inserts the <xpaths> body as a sibling after the matched element ● attributes - alters the attributes of the matched element using the special attribute elements in the <xpath> body
  • 13. ● After specifying this record we have to add it inside the manifest. ● So i have added the xml file inside the manifest and then you have to restart the service and go to apps and you have to search for your custom app.
  • 14. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo.