Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
3701 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 17
9568
2
thg 1 20
15290
16
thg 8 19
10238
1
thg 1 19
5499
3
thg 7 18
3894