コンテンツへスキップ
メニュー
この質問にフラグが付けられました
4 返信
7644 ビュー

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
8703
1
7月 25
6456
1
5月 25
1014
1
2月 25
2584
5
10月 24
11751