Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
4 Ответы
7628 Представления

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
8656
1
июл. 25
6415
1
мая 25
952
1
февр. 25
2521
5
окт. 24
11695