Se rendre au contenu
Menu
Cette question a été signalée
4 Réponses
4381 Vues

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
Ignorer
Auteur Meilleure réponse

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

Avatar
Ignorer
Meilleure réponse

can you try

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


Avatar
Ignorer
Auteur

Does not work

Publications associées Réponses Vues Activité
2
avr. 24
3981
2
mai 17
11302
1
déc. 16
8125
0
juil. 22
1650
1
janv. 22
11370