Understanding Model Inheritance and View Inheritance in Odoo 17. days 8. — Transcript
Full transcript
- 0:00hello so welcome to my YouTube channel
- 0:03now let me open the
- 0:06training okay so training course okay so
- 0:10here you can see the eight days here is
- 0:13the first topic is the model inheritance
- 0:15after that view inheritance okay today
- 0:18we will see model inheritance and VI
- 0:21inheritance how to use and what will
- 0:24what is the use and we can use how to
- 0:27use in the hood okay so let's start do
- 0:31not waste more time okay so first I'm
- 0:35tell you what I'm doing
- 0:37okay go to the sales module so this is
- 0:42the default module which is created in
- 0:45the adance by default okay basically go
- 0:49to the apps and install active the M
- 0:53once active the module this module will
- 0:55be so this way okay so I want to
- 1:00add one one field this object like here
- 1:04is the customer second is the order date
- 1:07and second after that the payment
- 1:08reference so I want to add one more
- 1:11field in existing models okay so how we
- 1:15can so let's we need to
- 1:19First inherit the existing modu after
- 1:22that we can add and how we will s in the
- 1:25front view okay so let's do it
- 1:30go to the py
- 1:34charm I'm inside the py charm go to the
- 1:39adance here is the advance see student
- 1:44management modules so now I'm creating
- 1:48one more file here which is called sales
- 1:54holder okay now enter here un P the
- 2:00import models and Fields and API after
- 2:05that I want to inherit sales class sale
- 2:11mod after that enter and
- 2:16inherit sale do order object why
- 2:20am WR here the sale do order why because
- 2:24of this model name is the sale order
- 2:28so here and inherit the existing module
- 2:32here and indentation correct control
- 2:36shift V
- 2:39okay now I want to add here one more
- 2:42field like
- 2:45uh sale order reference I want to add
- 2:48one field here sale order reference okay
- 2:52sale reference ref now name field this
- 2:55field will be correct type
- 2:59after that passing the parameter is a
- 3:02string
- 3:03sale R
- 3:06okay need to link with an internal init
- 3:10file form dot
- 3:12import sale order okay once I link this
- 3:17file in the internal files after that
- 3:21upgrade the modu and simply
- 3:27refresh once I refresh coming in the
- 3:29error is's saying the sale order module
- 3:33does not exist in the registry why why
- 3:35is coming this error because this object
- 3:39is
- 3:40created another model where is created
- 3:44this is created inside the sale module
- 3:46here see my mouse cursor okay there is
- 3:50adance inside the adance module name is
- 3:52the sale is the sale model where is the
- 3:54created name isal to sale do order okay
- 3:58need to add in the dependency
- 4:02sale what
- 4:03do sorry I need to
- 4:07link here WR
- 4:09sale after that need to
- 4:12run once I
- 4:15run and refresh the
- 4:18page see my my field is not coming here
- 4:22because I'm not add in the
- 4:25views I'm not inherit the views right
- 4:28now only inherit edit models if you can
- 4:32see here sale reference my field is
- 4:34coming or not here you can see my field
- 4:36is coming but this field is not showing
- 4:39in the form view because I'm not
- 4:41inhering the form views okay uh let's
- 4:46inherit the form view click on the
- 4:48developer mode go to the edit View and
- 4:53this
- 4:55F this external ID need to copy and
- 4:59control shift
- 5:01V search in the
- 5:03XML
- 5:05and anyone in herit code is copy let
- 5:11once I copy let then explain
- 5:15okay now need
- 5:17to create new one more file this file
- 5:21name will be
- 5:23S S
- 5:26View okay inside the
- 5:30starting
- 5:31tago and paste here so
- 5:35now in
- 5:38s renamed of ID
- 5:42this after that so inherit ID so this
- 5:48this ID will be pasted in the inherited
- 5:51line reference attribute is string okay
- 5:56after that where we where we want to add
- 5:59this field where we want to show okay I
- 6:01want to show this field after the
- 6:04payment term payment term ID payment
- 6:06term ID copy payment term ID and paste
- 6:09it here I want to add this uh sale
- 6:13reference field after the payment term
- 6:16ID okay let's now this we need to link
- 6:21in the manest file go to the Manifest
- 6:24and Link
- 6:27here okay after that upgrade the module
- 6:31once I upgrade the modu go to the sale
- 6:34order and refresh the page my field is
- 6:37coming so I can write here something
- 6:40else
- 6:41okay
- 6:44so okay then
- 6:47save okay or you can add this field by
- 6:51the
- 6:52xath
- 6:55okay if I'm adding through the field or
- 6:59after that I'm adding them xath through
- 7:01the xath X PA and ex ex PR this is the
- 7:06syntax first where we can okay I want to
- 7:11add after the this fi so first is start
- 7:14the starting tag is the seat inside the
- 7:17seat one group name this inside this
- 7:21group name after the this group group
- 7:25name this will be this okay inside I
- 7:28want to add this field inside the this
- 7:32group okay so first call
- 7:38Se seat inside the seat group is group
- 7:43group name this group inside the
- 7:48group there is the two group first group
- 7:51is the param partner details second in
- 7:53the order detail I want to add this
- 7:56field Group in order details group the
- 7:59name
- 8:00name
- 8:02is this one after
- 8:06the
- 8:08position
- 8:09after okay after that I'm add here now
- 8:16comment above so once I upgrade the modu
- 8:21and go go back to the sale order and
- 8:24refresh so my field coming
- 8:27here okay so I want to add this uh
- 8:32previously okay so go to the again
- 8:36form and go to the G
- 8:40form see inside this group inside this
- 8:45group one field is the payment term ID
- 8:49so here
- 8:52field at great
- 8:54name name will be
- 8:58payment okay
- 9:03so go to the home and refresh now my
- 9:08field coming previously after the
- 9:10payment okay so here you can use
- 9:15inherit okay so I may inherit the views
- 9:19and also inherit the sale
- 9:22order sorry sale order you can inherit
- 9:25the models like this way and also you
- 9:29can inherit the views with with
- 9:31inherited ID okay so this is the two
- 9:36topics if you have any confusion you can
- 9:38write the comment box one more thing
- 9:41this is the developer extension click on
- 9:43the
- 9:45extension and manage extension and go to
- 9:48the
- 9:49Chrome my system is not link with data
- 9:53let me link the data
- 10:02so it's link now
- 10:05refresh so here search de
- 10:10de then enter so this one is the oo
- 10:14developer mode simply install and pin
- 10:18here okay so thank you
About this transcript
This page contains the full transcript of Understanding Model Inheritance and View Inheritance in Odoo 17. days 8. by Odoo Tech , generated from the public captions YouTube serves with the video. The transcript has 1,123 words across 181 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.