Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
17270 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 18
8260
2
ก.ค. 24
1597
1
มิ.ย. 24
4136
1
ต.ค. 23
9567
1
ต.ค. 23
98