İçereği Atla
Menü
Bu soru işaretlendi
4 Cevaplar
4374 Görünümler

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.





Avatar
Vazgeç
Üretici En İyi Yanıt

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

Avatar
Vazgeç
En İyi Yanıt

can you try

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


Avatar
Vazgeç
Üretici

Does not work

İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Nis 24
3976
2
May 17
11301
1
Ara 16
8122
0
Tem 22
1648
1
Oca 22
11366