Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet

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.

Avatar
Verwerfen

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.

Autor

@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

Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Juli 24
1609
1
Sept. 15
5232
1
Juli 22
5416
2
Feb. 21
12784
3
Apr. 20
10918