跳至內容
選單
此問題已被標幟
4 回覆
17735 瀏覽次數

I need to store audio file from web url in binary field. now it's stored as unknown format. but, i need it's original file format like .mp3. can anyone show me the way?

頭像
捨棄
最佳答案

Pls. check this module: https://www.odoo.com/apps/modules/11.0/audio_field/
hope it will help you.
or you can add name of that file like abc.mp3 in file_name field.

頭像
捨棄
作者

Hi, can you provide a way in python if possible, because i'm not familiar with javascript. Thank you

when you are creating file from the code of python just add name in name field test.mp3

最佳答案

In .py file

attachment = fields.Binary(string="Attachment")    
store_fname = fields.Char(string="File Name")

In .xml file                               

<field name="store_fname" invisible="1" />
<field name="attachment" filename="store_fname" />

Hope this helps you

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
4月 18
8739
2
7月 24
2550
1
6月 24
5019
1
10月 23
10696
1
10月 23
98