Different types of inheritance in Odoo | Types of inheritance | Delegation inheritance

preview_player
Показать описание
Type of inheritance in Odoo, How to extend module in Odoo, How to use traditional (classic) or delegation inheritance in Odoo, How to extend Model or TransientModel in existing or different module. we can use as below.

Extend (Inheritance) same model
Here we will use the only _inherit, we will not use the _name model attribute. The child model replaces the existing one. This inheritance is used when we want to add new fields or methods to the existing model.

Traditional (Classical) Inheritance
In this inheritance, we use both _name and _inherit model attributes together. The new models get all methods, fields from its base.

Delegation Inheritance
In delegation inheritance, we use the _inherits model attribute. This is used if you want to use another model in your current model.

Here we will see below topics in detail.

Simple Inheritance
Traditional Inheritance
Delegation Inheritance
How to extend Wizard (TransientModel)
How to extend or override existing methods.

If you missed previous discussion related How to compare directory or files using PyCharm editor

Also how to get information from configuration file using backend in Odoo.

Subscribe - Share - Comment/Suggestion - Enjoy - DonateUS

#TraditionalInheritance #ClassicalInheritance #DelegationInheritance #OdooInheritance #ExtendModelClass #ExtendTransientModel #odoo #tinyerp #openerp
Рекомендации по теме
Комментарии
Автор

Thanks for this informative practical explanation. Plz, I have a question regarding methods when using inheritance. As I understood from odoo docs when using the “inherits” (delegation or multiples inheritance) methods of the base model will not be inherited right ? Now when using classical inheritance “inherit” with new _name metadata, should we necessarily use “Super” to inherit methods of the base model or they will be automatically inherited, which mean they gonna work in views (ex. a method that compute a field in the base model)?

SamirSELLAMI
Автор

Hi, I try to inherit the qty_delivered field in sale to the invoice but when I make a sale, the qty_delivered field does not automatically retrieve the value but offers me a drop-down list. I need a little help

abdoulayedabacoulibaly
Автор

I am using inherit option 2 above. when I remove inherit, then upgrade the module, it caused error..KeyError: 'model name', eventhough I have removed the table in psql.

decajohn
Автор

how "Tango' appears, it appear in mine " module.model.id "

kenzasouabni
visit shbcf.ru