Skip to Content
Menu
This question has been flagged
2 Replies
4459 Rodiniai

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!

Portretas
Atmesti
Best Answer

Hi,

Try like this,


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


Thanks

Portretas
Atmesti
Best Answer

Use this one,

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

Portretas
Atmesti

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 Replies Rodiniai Veikla
2
kov. 15
12526
3
rugp. 22
3906
7
rugp. 18
6022
16
gruod. 23
33039
3
liep. 25
4118