Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
4442 Ansichten

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
Verwerfen
Beste Antwort

Hi,

Try like this,


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


Thanks

Avatar
Verwerfen
Beste Antwort

Use this one,

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

Avatar
Verwerfen

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

Verknüpfte Beiträge Antworten Ansichten Aktivität
2
März 15
12502
3
Aug. 22
3868
7
Aug. 18
5986
16
Dez. 23
33004
3
Juli 25
4045