Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4537 มุมมอง

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
12625
3
ส.ค. 22
4154
7
ส.ค. 18
6179
16
ธ.ค. 23
33243
naked domain set up แก้ไขแล้ว
3
ก.ค. 25
4420