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

Hello, I would like to know in Odoo 14 if there is any way how to make checkbox field on view form greyed out when set to False. It means to behave in the same way like common text fields when empty.

頭像
捨棄
最佳答案

Hi,

Please refer the code below to change the label of checkbox to grey when it is disabled.

<div>


    <label for="checkbox_field" string="ssss" style="color:black;"


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


<label for="checkbox_field" string="ssss" style="color:grey;"


       attrs="{'invisible': [('checkbox_field', '=', True)]}"/>


<field name="checkbox_field" nolabel="1"/>


</div>

 

Regards

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
6月 21
2914
1
9月 24
2217
1
5月 23
2861
1
9月 21
5437
2
2月 16
6609