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

How do I make a field invisible by using attrs {invisible} on a computed many2many field in XML.

attachment_ids = fields.Many2many("ir.attachment", compute="_attachment_list")
@api.multi
def _attachment_list(self):
self.attachment_ids = self.env['ir.attachment'].search([('res_model','=','my.model'),('res_id','=',self.id)])

On my xml I have:

(button)
attrs="{'invisible': [('activity_vendor_id','=', False), ('attachment_ids', '=', False)]}"


I have tried [(6,False,[])] but return an error.





الصورة الرمزية
إهمال
الكاتب أفضل إجابة

I fixed using another Boolean field associated with the affected field.

الصورة الرمزية
إهمال
أفضل إجابة

can you try

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


الصورة الرمزية
إهمال
الكاتب

Does not work

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أبريل 24
3976
2
مايو 17
11301
1
ديسمبر 16
8122
0
يوليو 22
1648
1
يناير 22
11366