Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4 Risposte
2263 Visualizzazioni

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
Abbandona
Risposta migliore

Hello,

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


Hope it helps.

Avatar
Abbandona
Autore Risposta migliore

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

invisible="not qa_check_product_ids"


Avatar
Abbandona

Nice, up vote the answer or mark best one maybe

Risposta migliore

You can try

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

Avatar
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
ago 25
360
4
mag 25
2835
2
mag 25
6267
1
mar 25
1897
4
mar 25
4839