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

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.

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

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 6 21
2922
1
thg 9 24
2222
1
thg 5 23
2869
1
thg 9 21
5441
2
thg 2 16
6612