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

Hello,

I would like save image in file.

But how can I get the DATA_DIR variable define in openerp-server.conf in my function ?


Thanks,

Valérian

อวตาร
ละทิ้ง

for what will you use this image??

คำตอบที่ดีที่สุด

Hello,

You can define path in system parameter for image store.

Than you can use this path to store file and retrieve file.

img_file_data = base64.b64decode(image_data)
with open(your_path_for_store, 'wb') as f:
    f.write(imgdata)

You need some python code for achieve this.

May be this will help you.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You can access all the details saved in configuration file inside Odoo.

Sample code:

from openerp.tools import config
your_value = config['key_in_config_file']

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Okay,

It's done 

Thank you very much

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.ค. 25
8802
Upload Large File Store to Odoo.sh แก้ไขแล้ว
1
ก.ค. 25
6570
1
พ.ค. 25
1091
1
ก.พ. 25
2845
5
ต.ค. 24
11969