Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4 Risposte
8036 Visualizzazioni

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
Abbandona

for what will you use this image??

Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Autore Risposta migliore

Okay,

It's done 

Thank you very much

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
lug 25
9215
1
lug 25
7056
1
mag 25
1444
1
feb 25
3867
5
ott 24
12831