Skip to Content
Menu
This question has been flagged

Hi there

I have two different modules. How can I add a field from the first module in a view of the second module?

I don't get the whole inheritance part somehow, could somebody please explain it to me?

Thank you

Avatar
Discard
Best Answer

The inheritance mechanism has not changed. You can use:

class MyModelExtended(Model):
     _inherit = 'a.model'                       # direct heritage
     _inherit = ['a.model, 'a.other.model']     # direct heritage
     _inherits = {'a.model': 'field_name'}      # polymorphic heritage

For more details about inheritance please have a look at

http://odoo-new-api-guide-line.readthedocs.io/en/latest/environment.html?highlight=_inherits #inheritance


Avatar
Discard
Author Best Answer

Thank you, I will have a look at it. (Not yet 8karma, so I can't comment on your post, sorry)

Avatar
Discard
Related Posts Replies Views Activity
0
Oct 17
8310
2
Jan 20
13426
16
Aug 19
8647
1
Jan 19
4311
3
Jul 18
2603