コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
3703 ビュー

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

アバター
破棄
最善の回答

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


アバター
破棄
著作者 最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
0
10月 17
9570
2
1月 20
15294
16
8月 19
10238
1
1月 19
5503
3
7月 18
3896