Skip to Content
Menú
This question has been flagged
4 Respostes
7612 Vistes

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
Descartar

for what will you use this image??

Best Answer

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
Descartar
Best Answer

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
Descartar
Autor Best Answer

Okay,

It's done 

Thank you very much

Avatar
Descartar
Related Posts Respostes Vistes Activitat
3
de jul. 25
8612
1
de jul. 25
6326
1
de maig 25
906
1
de febr. 25
2450
5
d’oct. 24
11628