Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5924 Lượt xem

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     

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ

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>

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 23
3595
2
thg 12 21
5516
1
thg 8 22
3443
3
thg 11 22
8356
0
thg 1 22
2171