Skip to Content
Menu
This question has been flagged
2 Replies
2791 Views

we have the following custom field:

data_file = fields.Binary(string="Datei", attachement=True)

uploading files works perfectly. Downloading the files also works, except for files of type ".html". Such files raise an odoo Exception but the message-window is empty.

any ideas whats wrong with files of type text/html?


Avatar
Discard

Addons related to attachments?

Best Answer

Hello Jack,

Try below code for attachment download.

In PY :-

data_file = fields.Binary('Detail')
datas_fname = fields.Char('File Name')


In XML :-

<field name="data_file" filename="datas_fname"/>
<field name="datas_fname" invisible="1"/>


Hope it will works for you.

Thanks,

Avatar
Discard
Author

we use such code (tried with attachement=True or attachement=False). It works for different File types but not for ".html" Files. Downloading such files fails