Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
4 Odpovědi
7619 Zobrazení

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
Zrušit

for what will you use this image??

Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor Nejlepší odpověď

Okay,

It's done 

Thank you very much

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
čvc 25
8628
1
čvc 25
6365
1
kvě 25
924
1
úno 25
2489
5
říj 24
11656