Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
3884 Tampilan


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?

Avatar
Buang
Penulis Jawaban Terbai

I did it in write method

Avatar
Buang
Jawaban Terbai
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')
Avatar
Buang


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

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

Post Terkait Replies Tampilan Aktivitas
0
Des 24
1277
1
Mar 23
6453
0
Okt 21
2516
2
Mei 20
12061
2
Des 17
4162