Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5174 มุมมอง

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>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

You can use t-if. 

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


Thanks & Regards

Avinash N K

อวตาร
ละทิ้ง
ผู้เขียน

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>

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.ค. 23
30703
1
ก.ค. 23
2634
Customize document layout แก้ไขแล้ว
1
เม.ย. 22
7052
1
ก.พ. 22
2661
[Odoo10] QWeb t-if แก้ไขแล้ว
2
ก.ย. 17
13987