Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
3333 Vistas


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
Descartar
Autor Mejor respuesta

I did it in write method

Avatar
Descartar
Mejor respuesta
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
Descartar


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

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

Publicaciones relacionadas Respuestas Vistas Actividad
0
dic 24
715
1
mar 23
5791
0
oct 21
2166
2
may 20
11588
2
dic 17
3758