Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
21263 Vizualizări

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!

Imagine profil
Abandonează
Autor

@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.

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

Autor

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

Cel mai bun răspuns

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!

Imagine profil
Abandonează
Cel mai bun răspuns

@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.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
dec. 19
4882
4
ian. 24
23047
2
ian. 24
2396
0
aug. 23
2268
2
dec. 22
14740