跳至內容
選單
此問題已被標幟

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.

頭像
捨棄

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

相關帖文 回覆 瀏覽次數 活動
2
7月 24
1588
1
9月 15
5195
1
7月 22
5372
2
2月 21
12745
3
4月 20
10906