Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4 Відповіді
7650 Переглядів

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

Аватар
Відмінити

for what will you use this image??

Найкраща відповідь

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.

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Автор Найкраща відповідь

Okay,

It's done 

Thank you very much

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
3
лип. 25
8708
1
лип. 25
6468
1
трав. 25
1017
1
лют. 25
2606
5
жовт. 24
11767