Ayuda

0

How do I download a file from tree view using widget="binary" but retaining its original file name?

Avatar
Serge Mercado

In tree view or one2many lines, I have a binary field that has an attribute of widget="binary".

However, when I download from the tree view it the file name becomes 'my.model-1-my_field.pdf' and not the original file name.

<field name="my_field" widget="binary"/>
1 Comentario
Avatar
Descartar
Avatar
Oğuzhan Dikici
-


"
"


2 Respuestas
0
Avatar
Serge Mercado
Best Answer

This is now possible in Odoo 14.

Avatar
Descartar
0
Avatar
François Wyaime
Best Answer

You have to add a char field 'filename' to your model and add "filename" attribute to your view.


See code below:

<field name="document" filename="document_fname" widget="binary"/>
<field name="document_fname" invisible="1"/>
Avatar
Descartar