Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
3826 Vues


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
Ignorer
Auteur Meilleure réponse

I did it in write method

Avatar
Ignorer
Meilleure réponse
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
Ignorer


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

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

Publications associées Réponses Vues Activité
0
déc. 24
1207
1
mars 23
6395
0
oct. 21
2488
2
mai 20
12024
2
déc. 17
4116