Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
4452 Prikazi

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

Hi,

Try like this,


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


Thanks

Avatar
Opusti
Best Answer

Use this one,

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

Avatar
Opusti

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 Odgovori Prikazi Aktivnost
2
mar. 15
12520
3
avg. 22
3886
7
avg. 18
6003
16
dec. 23
33031
3
jul. 25
4098