Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
4334 Представления

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!

Аватар
Отменить
Лучший ответ

Hi,

Try like this,


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


Thanks

Аватар
Отменить
Лучший ответ

Use this one,

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

Аватар
Отменить

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 Ответы Просмотры Активность
2
мар. 15
12402
3
авг. 22
3713
7
авг. 18
5885
16
дек. 23
32898
3
июл. 25
3815