콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
4365 화면

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
3963
2
5월 17
11285
1
12월 16
8109
0
7월 22
1625
1
1월 22
11357