Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
4201 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
เม.ย. 24
3820
2
พ.ค. 17
11161
1
ธ.ค. 16
7989
0
ก.ค. 22
1550
1
ม.ค. 22
11262