Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
4460 Vues

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
Ignorer
Meilleure réponse

Hi,

Try like this,


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


Thanks

Avatar
Ignorer
Meilleure réponse

Use this one,

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

Avatar
Ignorer

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

Publications associées Réponses Vues Activité
2
mars 15
12526
3
août 22
3908
7
août 18
6023
16
déc. 23
33040
3
juil. 25
4119