Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
4 Odpowiedzi
7613 Widoki

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

Awatar
Odrzuć

for what will you use this image??

Najlepsza odpowiedź

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

Okay,

It's done 

Thank you very much

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
lip 25
8616
1
lip 25
6330
1
maj 25
909
1
lut 25
2466
5
paź 24
11634