Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
5182 Tampilan

For example,
Like the below function,easily set the invisible function in ~addons/hr/views/*.xml
<field name="resign_date" attrs="{'invisible':[('resign_date', '=', '9000-12-31')]}"/>
but how to set the specific field to invisible in printed report in ~addons/hr/report/*.xml
<tr t-foreach="docs" t-as="l">
<td>
<span t-field="l.resign_date"/>
</td>
</tr>

Avatar
Buang
Jawaban Terbai

Hi,

You can use t-if. 

<t t-if="your condition">
       <span t-field="l.resign_date"/>                       
</t>


Thanks & Regards

Avinash N K

Avatar
Buang
Penulis

No matter the date is '9000-12-31' or not,still display in the printed report.What's the mistake of the code?

<td>

<t t-if="l.resign_date != '9000-12-31'">

<span t-field="l.resign_date"/>

</t>

</td>

Post Terkait Replies Tampilan Aktivitas
3
Jul 23
30705
1
Jul 23
2636
1
Apr 22
7052
1
Feb 22
2661
2
Sep 17
13991