Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
4 Replies
7746 Tampilan

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

Avatar
Buang

for what will you use this image??

Jawaban Terbai

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.

Avatar
Buang
Jawaban Terbai

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']

Avatar
Buang
Penulis Jawaban Terbai

Okay,

It's done 

Thank you very much

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
3
Jul 25
8886
1
Jul 25
6684
1
Mei 25
1142
1
Feb 25
3042
5
Okt 24
12195