Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
4345 Weergaven

Hi i'm totally new in python, hope i will get help from experience person. Is possible to get data one model to another in a model using foreign key.... I tried this way but can getting result ....


    class A(models.Model):

        _inherit = 'project.task'

        field_a = fields.Char(string='field_a')

        field_b = fields.Char('field_b')

    class B(models.Model):

        # _inherit = 'project.task'

        field_a = fields.Char(string='field_a class B')

        field_b2 = fields.Char(string='field_b2')

    class C(models.Model):

        # _inherit = 'project.task'

        field_a = fields.Char('field_a class C')

        field_c = fields.Char('field_c')

Avatar
Annuleer
Beste antwoord

hello Anchal,

You need to use many2one relation field, or many2many:

https://www.odoo.com/documentation/8.0/howtos/backend.html#relations-between-models

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
apr. 24
1787
4
nov. 23
5835
0
okt. 23
1619
0
dec. 22
2505
2
dec. 23
19184