Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
4799 Tampilan

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
Buang
Jawaban Terbai

Hi,

Try like this,


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


Thanks

Avatar
Buang
Jawaban Terbai

Use this one,

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

Avatar
Buang

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

Post Terkait Replies Tampilan Aktivitas
2
Mar 15
12918
3
Agu 22
4584
7
Agu 18
6454
16
Des 23
33628
3
Jul 25
4946