Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
4 Antwoorden
2212 Weergaven

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
Annuleer
Beste antwoord

Hello,

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


Hope it helps.

Avatar
Annuleer
Auteur Beste antwoord

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

invisible="not qa_check_product_ids"


Avatar
Annuleer

Nice, up vote the answer or mark best one maybe

Beste antwoord

You can try

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

Avatar
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
aug. 25
235
4
mei 25
2777
2
mei 25
6203
1
mrt. 25
1843
4
mrt. 25
4773