コンテンツへスキップ
メニュー
この質問にフラグが付けられました
4 返信
4007 ビュー

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.





アバター
破棄
著作者 最善の回答

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

アバター
破棄
最善の回答

can you try

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


アバター
破棄
著作者

Does not work

関連投稿 返信 ビュー 活動
2
4月 24
3602
2
5月 17
11021
1
12月 16
7838
0
7月 22
1447
1
1月 22
11109