Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
4323 Vistas

Hello all,

'mediaid' is a fields.Char in my customize model.

mediaid = fields.Char(string='Media Id')

I add a button in the form view of this mode.

<button name="My Button" type="object" string="do_something" attrs="{'invisible': [('mediaid', '=', None)]}"/>

But the button is still visible when the data in 'mediaid' is 'None'.

So, How to fix the view code to make it invisible?

Please help!

Avatar
Descartar
Mejor respuesta

Hi,

Try like this,


<button name="My Button" type="object" string="do_something" attrs="{'invisible': [('mediaid', '=', False)]}"/>


Thanks

Avatar
Descartar
Mejor respuesta

Use this one,

attrs="{'invisible': [('mediaid', '=', False)]}"

Avatar
Descartar

Hi, already the same answer is given above and it gets upvoted. Then why the same?

ok i think its by mistake, i have not seen the above one

Publicaciones relacionadas Respuestas Vistas Actividad
2
mar 15
12368
3
ago 22
3678
7
ago 18
5868
16
dic 23
32866
3
may 25
3739