跳至内容
菜单
此问题已终结
4 回复
2234 查看

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:


形象
丢弃
相关帖文 回复 查看 活动
0
8月 25
294
4
5月 25
2789
2
5月 25
6210
1
3月 25
1850
4
3月 25
4779