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

Display fields of other model in a view

By
José
on 1/8/15, 6:27 AM 2,187 views

Hello, I have Odoo8.

I have a view of a specified model by: <field name="model">sale.order</field> for example.

If I want to display in that view values from other model related with this, for example the display_name of the partner_id, how can I do? If I do this <field name="partner_id.display_name" /> (in the "arch" field, of course) I get an internal server error when install the module.

Thanks!

@Ivan, this works in Odoo8? I don't find any reference in the docs and I do this related_display = fields.related('partner_id', 'display_name') and not works.

José
on 1/8/15, 7:23 AM

Hola Jose, lograste mostrar un campo de otro modelo en una vista?? Porque estoy con el mismo problema y no encuentro solucion

Francisco Tobar
on 10/16/15, 8:13 AM

Hola, pude hacerlo con las respuestas que me indicaron abajo. ¿Vos no pudiste?

José
on 10/19/15, 9:03 AM
2
Kalpana Hemnani
On 1/8/15, 8:33 AM

Hello José,

You can define related field for this as below:

display_name = fields.Char('Display Name', related='partner_id.display_name',store=True)

Thanks!

2

Ivan

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

@Jose, you need to create a related field to display it, so 'display_name' = fields.related('partner_id', 'display_name', ....) and use 'display_name' in your view.

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/8/15, 6:27 AM
Seen: 2187 times
Last updated: 10/19/15, 9:03 AM