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

I have implemented prototype inheritance..

class Module(models.Model):       
 _inherit = ['ir.model']     
_name = 'test.ir.model'

what i am looking for is i don't want to write my own view.

i want to use parent view of ir.model with prototype inheritance.

is there any way to do it?


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You can use class inheritance to achieve this. Normally by prototype inheritance the newly created data or fields will not be accessible if you are using the parent model on your new view. But this will not be the case if you are simply inheriting the main model like class inheritance.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

@hilar can you please post a demo code for class inheritance you are talking about. thank you for instant reply.

อวตาร
ละทิ้ง

class xx(..)

{

_name = 'x'

_inherit = 'x'

...

...

extra fields

...

}

xx(..)

ผู้เขียน

I want to use view of ir.model, but want to create records under test.ir.model i don't think it is possilbe with class inheritance because it will not copy all the fields in test.ir.model is there any other way to do so?

hi hirenj, did you find out a solution? I got similar issue here. please help me out if you have any hint. Thanks a lot!

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 22
3217
3
ก.ย. 19
7336
2
ต.ค. 18
4649
4
ก.พ. 25
2326
1
ส.ค. 24
1969