跳至内容
菜单
此问题已终结
4 回复
7616 查看

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

形象
丢弃
相关帖文 回复 查看 活动
3
7月 25
8622
1
7月 25
6357
1
5月 25
915
1
2月 25
2472
5
10月 24
11637