跳至內容
選單
此問題已被標幟
1 回覆
5198 瀏覽次數

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>

相關帖文 回覆 瀏覽次數 活動
3
7月 23
30731
1
7月 23
2645
1
4月 22
7073
1
2月 22
2669
2
9月 17
14005