Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
4 Antworten
7726 Ansichten

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
Verwerfen

for what will you use this image??

Beste Antwort

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
Verwerfen
Beste Antwort

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
Verwerfen
Autor Beste Antwort

Okay,

It's done 

Thank you very much

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
3
Juli 25
8871
1
Juli 25
6657
1
Mai 25
1124
1
Feb. 25
2974
5
Okt. 24
12119