Welcome!

This community is for professionals and enthusiasts of our products and services.Share and discuss the best content and new marketing ideas,build your professional profile and become a better marketer together.

Register
1

How can I extend models?

By
Diogo Duarte
on 11/4/15, 9:47 PM430 views

How can I extend the existing Odoo models?


0
Diogo Duarte
On11/4/15, 9:49 PM

There are three different mechanisms to extend models: When using "_inherit" but leaving out "_name", the new model replaces the existing one, this is useful to add/customize fields/methods; When using the "_inherit" and "_name" attributes together, Odoo creates a new model using the existing one (provided via "_inherit") as a base, the new model gets all the fields and methods from its base; When using the "_inherits" (note the additional "s") a model delegates the lookup of any field not found on the current model to "children" models. The delegation is performed via Reference fields automatically set up on the parent model and methods are not inherited, only fields.


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, justuse the commenting tool. Please remember that you can alwaysrevise your answers - no need to answer the same question twice. Also, pleasedon't forget to vote - it really helps to select the best questions and answers!

Keep Informed

About This Community

This community is for professionals and enthusiasts of our products and services.Share and discuss the best content and new marketing ideas,build your professional profile and become a better marketer together.

Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 11/4/15, 9:47 PM
Seen: 430 times
Last updated: 11/5/15, 1:25 AM