Spirit angel
Spirit angel

Reputation: 191

OpenERP: How to display fields of two objects within the same view?

How can I display fields of two record in the same tree view, Knowing that these tables are linked with OneToMany relashionship ?

here is my field:

    'class_id': fields.many2one('mod.class', 'Entree', required=True),

In my tree view :

    <field colspan="4" name="class_id" nolabel="1" widget="one2many_list"/>

But this can just display foreign key but i need other fields

I'll appreciate any help .Thank you

Upvotes: 2

Views: 2513

Answers (3)

OmaL
OmaL

Reputation: 5044

In OpenERP's addons folder goto addons > base > partner > partner.py, there you can see a field named 'address' which is a one2many field. Also you can find some related fields like 'mobile','phone','city' etc. which are related to the address field. These related fields can be used in the tree view.

This is the same thing that you are trying to do.

Upvotes: 0

Don Kirkby
Don Kirkby

Reputation: 56660

Usually, I use a related field to display fields from a related table.

Upvotes: 3

Ruchir
Ruchir

Reputation: 11

Make related field or make a view(database) without table like many reports. Or make dashboard type view . It is upto you and your requirement.

Upvotes: 1

Related Questions