تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
4327 أدوات العرض

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
مارس 15
12382
3
أغسطس 22
3693
7
أغسطس 18
5872
16
ديسمبر 23
32878
naked domain set up تم الحل
3
يوليو 25
3776