콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
21391 화면

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.

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

작성자

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

베스트 답변

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!

아바타
취소
베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
2
12월 19
4992
4
1월 24
23381
Attrs attribute 해결 완료
2
1월 24
2591
0
8월 23
2382
2
12월 22
14967