Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
4 Replies
2215 Tampilan

Hi Odooers,

I want  "Btn eval" to be invisible when "QA Checking products" field (a many2many field) is empty. 

With codes below, the "Btn eval" is still showing. Please correct me if I am wrong in the xml codes

invisible="qa_check_product_ids == False"






Avatar
Buang
Jawaban Terbai

Hello,

You could try this instead:invisible="not qa_check_product_ids"


Hope it helps.

Avatar
Buang
Penulis Jawaban Terbai

Thank all of you. I use the following and now the result is expected.

invisible="not qa_check_product_ids"


Avatar
Buang

Nice, up vote the answer or mark best one maybe

Jawaban Terbai

You can try

"not qa_check_product_ids". Normally relation field like many2one or x2m will use "not"

Avatar
Buang
Jawaban Terbai

Hi,

The expression qa_check_product_ids == False won't work as expected because many2many fields are represented by a list, and an empty list is not equal to False. Instead, you need to check if the list is empty.

You can try it like that:


Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Agu 25
238
4
Mei 25
2781
2
Mei 25
6205
1
Mar 25
1846
4
Mar 25
4776