Skip to Content
मेन्यू
This question has been flagged
4 Replies
4265 Views

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
Discard
Author Best Answer

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

Avatar
Discard
Best Answer

can you try

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


Avatar
Discard
Author

Does not work

Related Posts Replies Views Activity
2
अप्रैल 24
3872
2
मई 17
11243
1
दिस॰ 16
8035
0
जुल॰ 22
1591
1
जन॰ 22
11298