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.
To pytanie dostało ostrzeżenie
5273
Widoki
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się| Powiązane posty | Odpowiedzi | Widoki | Czynność | |
|---|---|---|---|---|
|
|
2
lip 24
|
3304 | ||
|
|
1
wrz 15
|
6731 | ||
|
|
1
lip 22
|
7520 | ||
|
|
2
lut 21
|
14873 | ||
|
|
3
kwi 20
|
12860 |
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