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

Hello there,

In a qweb report, does it exist a operator to detect if a field contains a particular string?

Example :

<div t-if="p.name contains 'SUM'">
    <p>bla bla bla</p>
</div>


Thanks to help!


EDIT #1

After the tip of mister Ray Carnes, I have try this one. No success. Syntax error.

                            <tr t-foreach="get_payslip_lines(o.line_ids)" t-as="p">
<td t-if="p.name like '%SUM%'">
<span>IT WORKS!!!!</span>
</td>
    
.......



아바타
취소
베스트 답변

Hi,

You try:

<t t-if="'SUM' in p.name">
    <span>OK</span>
</t>
아바타
취소
작성자

Exactly what I needed! Thanks a lot.

베스트 답변

Would this work (have not tested)?

<div t-if="p.name like '%SUM%'">
<p>bla bla bla</p>
</div>
아바타
취소
작성자

I test it right now. I come back soon. Thanks a lot.

작성자

It doesn't seem to work. It is not the first time I meet this problem with t-if in qweb.

관련 게시물 답글 화면 활동
0
8월 16
4262
1
3월 15
20764
0
6월 24
17
0
2월 24
1731
0
6월 21
3968