Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
4 Respostas
4381 Visualizações

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
Cancelar
Autor Melhor resposta

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

Avatar
Cancelar
Melhor resposta

can you try

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


Avatar
Cancelar
Autor

Does not work

Publicações relacionadas Respostas Visualizações Atividade
2
abr. 24
3981
2
mai. 17
11302
1
dez. 16
8125
0
jul. 22
1650
1
jan. 22
11370