Odoo Help

Welcome!

This community 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.

0

Showing record from another object as one2many

By
Ajeng Shilvie
on 1/16/15, 5:04 AM 524 views

how to show record from another objek as one2many in current objek ? it just showing and saving it's id ,,

example i have 2 objek , it called first object and second object both of them has partner id , i create some data in first objek. Then all data from first objek have to shown in second object one2many field base on partner_id , how to do that ? thanks

nic question ajeng..

aci aisha
on 1/16/15, 5:06 AM

r u an odoo partner?

aci aisha
on 1/16/15, 5:06 AM

No, i am a developer .. Do you know the answer for my question?

Ajeng Shilvie
on 1/16/15, 5:13 AM
0

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 1/16/15, 6:21 AM

Firstly, both must be linked to res.partner, right?  So, you for the 2nd object you can create field one2many field in res.partner first.

Then you create a related field from 1st object, using partner_id as the link.  e.g. 'field_from_2nd_obj': field.related('partner_id', 'field_name_of_2nd_obj_in_res_partner'', type='one2many', ....).  Then you can use this in the view.

@ivan what fields are in one2many res.partner ? is it same as my second object line ?

Ajeng Shilvie
on 1/16/15, 7:07 AM

If you don't have it already then you should create it first, and yes it should link to the 2nd object.

Ivan
on 1/16/15, 7:34 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/16/15, 5:04 AM
Seen: 524 times
Last updated: 3/16/15, 8:10 AM