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

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"






อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello,

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


Hope it helps.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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

invisible="not qa_check_product_ids"


อวตาร
ละทิ้ง

Nice, up vote the answer or mark best one maybe

คำตอบที่ดีที่สุด

You can try

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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:


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
4
พ.ค. 25
2427
2
พ.ค. 25
5757
1
มี.ค. 25
1610
4
มี.ค. 25
4400
3
ก.พ. 25
5381