Odoo Help


access data from one model to another using foreign key.

on 3/24/16, 2:13 AM 510 views

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')

Yves Bourgois
On 3/24/16, 4:50 AM

hello Anchal,

You need to use many2one relation field, or many2many:


About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/24/16, 2:13 AM
Seen: 510 times
Last updated: 3/24/16, 4:50 AM