跳至内容
菜单
此问题已终结
2 回复
4527 查看

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

相关帖文 回复 查看 活动
2
3月 15
12622
3
8月 22
4146
7
8月 18
6179
16
12月 23
33237
3
7月 25
4411