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

Hi

I would like to know how can I use an option of a selection field in a view to show a custom field in a report

For example I have this selection field

mySelection = fields.Selection([
('01', 'Number 1'),
('02', 'Number 2'),
('03', 'Number 3'),
('04', 'Number 4')
],required=True)

And I would like to show in a report a custom field when for example the option 02 is selected

Im trying like this 

<t t-if="doc.mySelection == 'Number 2'">
<span t-field="custom_field"/></t>

But it doesn't show my field

Thank you for the help

아바타
취소
베스트 답변

Hi,

Compare using the key, try this.

<t t-if="doc.mySelection == '02'">
<span t-field="custom_field"/></t>


Thanks

아바타
취소
작성자

Thanks, I did that and it worked

관련 게시물 답글 화면 활동
2
9월 24
1909
5
8월 19
46512
4
6월 18
20057
0
6월 18
3279
2
12월 17
16889