Hello there,
I'm newbie in here, so my question is how can I add new relational fields One2many inside my existing inherit model??
Thank you.
คำถามนี้ถูกตั้งค่าสถานะ
5333
มุมมอง
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ| Related Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
|---|---|---|---|---|
|
|
2
ก.ค. 24
|
3427 | ||
|
|
1
ก.ย. 15
|
6807 | ||
|
|
1
ก.ค. 22
|
7677 | ||
|
|
2
ก.พ. 21
|
14970 | ||
|
|
3
เม.ย. 20
|
12942 |
Are you not able to do it by defining new fields in the inherited model like this
class A(models.Model):
field1
field2
class B(models.Model):
_inherit="A"
one2many_field = fields.One2many(codmodel, inverse_name)
many2many_field = fields.Many2many(comodel)
??
Would have been nicer if you could add more information about the problem you're facing.
@Karan BK, hey there I've found the solution. What I have done wrong is not mentioned inverse relation in my main module, after doing this things works well, anyway thanks for response. Thanks