Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4328 Lượt xem

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!

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Try like this,


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


Thanks

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Use this one,

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

Ảnh đại diện
Huỷ bỏ

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 15
12391
3
thg 8 22
3696
7
thg 8 18
5877
16
thg 12 23
32883
naked domain set up Đã xử lý
3
thg 7 25
3799