Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3690 มุมมอง

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)

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ต.ค. 17
9566
2
ม.ค. 20
15287
16
ส.ค. 19
10236
1
ม.ค. 19
5493
3
ก.ค. 18
3891