Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
3804 Visualizzazioni


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
Abbandona
Autore Risposta migliore

I did it in write method

Avatar
Abbandona
Risposta migliore
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
Abbandona


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

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

Post correlati Risposte Visualizzazioni Attività
0
dic 24
1185
1
mar 23
6378
0
ott 21
2478
2
mag 20
12014
2
dic 17
4103