跳至內容
選單
此問題已被標幟
4 回覆
4166 瀏覽次數

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
3775
2
5月 17
11125
1
12月 16
7969
0
7月 22
1536
1
1月 22
11246