Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3881 Переглядів

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

Related Posts Відповіді Переглядів Дія
2
лип. 24
1607
1
вер. 15
5226
1
лип. 22
5399
2
лют. 21
12782
3
квіт. 20
10916