Skip to Content
Menú
This question has been flagged
2 Respostes
4441 Vistes

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
Best Answer

Hi,

Try like this,


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


Thanks

Avatar
Descartar
Best Answer

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

Related Posts Respostes Vistes Activitat
2
de març 15
12500
3
d’ag. 22
3864
7
d’ag. 18
5986
16
de des. 23
32998
3
de jul. 25
4019