The central principle of clean Odoo development is to extend, not replace, and inheritance is the mechanism of extending. There are three types. This piece is about the three types of inheritance in Odoo.
Inheritance: the mechanism of extending
The principle that runs through clean Odoo development is to extend existing things rather than replace them, and inheritance is the mechanism by which Odoo is extended. Inheritance is how a developer adds to, or adjusts, what Odoo, or another module, already provides, cleanly, as a layer on top, rather than rewriting it. Because the things being extended in Odoo are of different kinds, there are, broadly, three types of inheritance, for the different kinds of thing.
Model inheritance
The first type is the inheritance of models. A developer often needs to extend an existing model, an existing kind of record, to add a field to it, to add or adjust its logic. Model inheritance is how that is done: the developer extends the existing model, adding the field or the logic, cleanly, while the existing model stays as it is underneath. Model inheritance is the back-end inheritance, the extending of the data-and-logic side.
View inheritance
The second type is the inheritance of views. A developer often needs to extend an existing view, an existing form view or list view, to add a field to it, to adjust how it is laid out. View inheritance is how that is done: an inheriting view expresses just the genuine changes to the existing view, which stays intact underneath, with the change a clean layer on top. View inheritance is the extending of the view side, the way the interface is changed cleanly.
The extending of further things
Beyond models and views, the principle of extending applies to the further things Odoo is made of. The front end is extended, existing front-end components extended rather than replaced, through the front-end means of extending. Reports are extended, an existing report's template extended rather than rewritten. The point of speaking of three types of inheritance is that the one principle, extend rather than replace, applies across the kinds of thing Odoo is made of, with the type of inheritance suited to each: the back-end side, the view side, and the further things, each extended in the way that suits it.
Why the three types matter as one principle
What matters most about the three types of inheritance is that they are one principle. Whatever a developer is extending, a model, a view, a report, a front-end component, the principle is the same: extend it cleanly, as a layer on top, leaving the existing thing intact, rather than replacing it wholly. The three types of inheritance are how that one principle is genuinely carried out across the different kinds of thing. A developer who understands inheritance, in its types, understands the central mechanism by which Odoo is extended cleanly, which is the heart of clean, maintainable Odoo development.
The takeaway
The three types of inheritance in Odoo are how Odoo is extended cleanly across the different kinds of thing it is made of: model inheritance, for extending an existing model, the data-and-logic side; view inheritance, for extending an existing view, the interface side; and the extending of the further things, the front end, the reports, each in the way that suits it. They are, in truth, one principle, extend rather than replace, carried out across the kinds of thing. Inheritance is the central mechanism of clean, maintainable Odoo development. For how we approach Odoo, see our ERP practice.