Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
4 Răspunsuri
7621 Vizualizări

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

Imagine profil
Abandonează

for what will you use this image??

Cel mai bun răspuns

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.

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor Cel mai bun răspuns

Okay,

It's done 

Thank you very much

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
3
iul. 25
8640
1
iul. 25
6382
1
mai 25
932
1
feb. 25
2501
5
oct. 24
11672