تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4 الردود
2014 أدوات العرض

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:


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
4
مايو 25
2216
2
مايو 25
5573
1
مارس 25
1436
4
مارس 25
4218
3
فبراير 25
5186