Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
5614 Zobrazení

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     

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit

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>

Related Posts Odpovědi Zobrazení Aktivita
1
dub 23
3293
2
pro 21
5173
1
srp 22
3068
3
lis 22
8000
0
led 22
1931