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

I have a field(boolean) in sale.order that I want to have printed to my QWeb:

sale_quotation_builder.sale_order_portal_content_inherit_sale_quotation_builder

Right now I have:

<td><span t-if="sale_order.x_pm_cr == 'true'"/>Credit</td>

This always prints "Credit" to the QWeb report, wether the field in sale.order view is selected or not.

I want it only to print "Credit" if my field sale_order.x_pm_cr is selected as true through its boolean box.


thank you,

d

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

Hi,

Try this,

<td>
<t t-if="sale_order.x_pm_cr'">
Credit
</t>
</td>

Thanks

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

It should be like:

< t t-if="your_condition.value == True" >
​< t t-esc="value" / >
< / t >

Or 

< t t-if="your_condition.value == 1 " >
​< t t-esc="value" / >
< / t >

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