跳至内容
菜单
此问题已终结
1 回复
5837 查看

How can i hide a field using xml in qweb report if there is no data in the respective field

right now i have used the xml code something like this but its not working




inherit_id="purchase.report_purchaseorder_document">
position="after">

Description


position="after">

attrs="{'invisible':[('parameter_field_mechanical', '!=', False)]}"/>




Can someone please tell me how can i achieve this goal     

形象
丢弃
最佳答案

Hello Jo,

You can use t-if condition to hide field if it does not have data.

Find example code in Comment section.

You can find the above example in purchase order report's code.

Hope it will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

形象
丢弃

Example :
<div t-if="o.dest_address_id">
<div t-field="o.dest_address_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone"],
"no_marker": True, "phone_icons": True}' name="purchase_shipping_address"/>
</div>

相关帖文 回复 查看 活动
1
4月 23
3492
2
12月 21
5427
1
8月 22
3353
3
11月 22
8261
0
1月 22
2089