İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
3853 Görünümler


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
Vazgeç
Üretici En İyi Yanıt

I did it in write method

Avatar
Vazgeç
En İyi Yanıt
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
Vazgeç


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

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

İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Ara 24
1233
1
Mar 23
6416
0
Eki 21
2500
2
May 20
12043
2
Ara 17
4134