Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
3973 Visualizações


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
Cancelar
Autor Melhor resposta

I did it in write method

Avatar
Cancelar
Melhor resposta
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
Cancelar


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

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

Publicações relacionadas Respostas Visualizações Atividade
0
dez. 24
1329
1
mar. 23
6524
0
out. 21
2551
2
mai. 20
12120
2
dez. 17
4211