Invisible Field Notation for using many2many hide field based on selected values

717 views Asked by At

I have a question about the invisible field If I then have the following Field: A00, Possible Values: red,blue, green, orange, purple Selected Values: red,green, purple Type: many2many

Field: B00

Type: many2one B00 should be hidden when red and blue are selected in A00 This must also work when other colours are also selected (e.g red,blue,green,orange)

How would I create this correctly in the invisible attribute ?

Many thanks Samuel

2

There are 2 answers

3
Dayana On

You could try:

<field name="B00" attrs="{'invisible': [('A00', 'in', ('red','blue'))]}"/>

I hope this help you ;)

0
dccdany On

is red, blue, the name of the many2many field? if it is then:

<field name="B00" attrs="{'invisible': [('A00.name', 'in', ('red','blue'))]}"/>

should work.