Skip to Content
Menu
This question has been flagged
4 Replies
7693 Rodiniai

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

Portretas
Atmesti

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.

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

Portretas
Atmesti
Autorius Best Answer

Okay,

It's done 

Thank you very much

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
3
liep. 25
8768
1
liep. 25
6541
1
geg. 25
1067
1
vas. 25
2792
5
spal. 24
11927