Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
4 Besvarelser
7677 Visninger

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
Kassér

for what will you use this image??

Bedste svar

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
Kassér
Bedste svar

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
Kassér
Forfatter Bedste svar

Okay,

It's done 

Thank you very much

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
3
jul. 25
8749
1
jul. 25
6522
1
maj 25
1045
1
feb. 25
2732
5
okt. 24
11881