Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2717 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มิ.ย. 21
2873
1
ก.ย. 24
2175
1
พ.ค. 23
2818
1
ก.ย. 21
5416
2
ก.พ. 16
6589