跳至內容
選單
此問題已被標幟
1 回覆
1039 瀏覽次數

is_service_available = fields . Boolean (string = "Service Availability", default = False)


< div t-if = "record.is_service_available.value == True " >

< span style = "color: green;" > ON NET </ span ></div>​​

< div t-else = "" > 

< span style = "color: red;" > OFF NET </ span ></ div >



odoo 17, how to check boolean conditions in xml

頭像
捨棄
最佳答案

Hi,
May be you missed else condition ?

< t t-if = "record.is_service_available" >

< span style = "color: green;" > ON NET </ span >

</ t >

<t t-else="">

< span style = "color: red;" > OFF NET </ span >
</ t >

Thanks

頭像
捨棄
作者

Tried that too, but something seems missing

相關帖文 回覆 瀏覽次數 活動
0
8月 24
1637
0
10月 16
3897
3
7月 15
10573
0
11月 24
1137
3
7月 23
6939