Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
5187 Переглядів

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
30713
1
лип. 23
2638
1
квіт. 22
7056
1
лют. 22
2665
[Odoo10] QWeb t-if Вирішено
2
вер. 17
13993