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


I have binary field with attachment=true. All those files have been saved with name of binary field. I want that those files will be automatically save with the same name as res_name. How to do that?

아바타
취소
작성자 베스트 답변

I did it in write method

아바타
취소
베스트 답변
You can achieve it by doing the following:

attachment_id = fields.Many2one('ir.attachment', string='Attachment')

attachment_fname = fields.Char('Attachment Filename', related='attachment_id.name')
아바타
취소


<field name="attachment_fname" invisible="1"/>

<field name="attachment_id" filename="attachment_fname"/>

관련 게시물 답글 화면 활동
0
12월 24
1497
1
3월 23
6716
0
10월 21
2674
2
5월 20
12254
2
12월 17
4338