Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
4 Odpovědi
3981 Zobrazení

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
Zrušit
Autor Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

can you try

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


Avatar
Zrušit
Autor

Does not work

Related Posts Odpovědi Zobrazení Aktivita
2
dub 24
3569
2
kvě 17
10976
1
pro 16
7816
0
čvc 22
1413
1
led 22
11067