Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
3980 Weergaven


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
Annuleer
Auteur Beste antwoord

I did it in write method

Avatar
Annuleer
Beste antwoord
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
Annuleer


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

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

Gerelateerde posts Antwoorden Weergaven Activiteit
0
dec. 24
1330
1
mrt. 23
6525
0
okt. 21
2551
2
mei 20
12120
2
dec. 17
4213