跳至內容
選單
此問題已被標幟
4 回覆
7625 瀏覽次數

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
8652
1
7月 25
6399
1
5月 25
943
1
2月 25
2511
5
10月 24
11688