Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
7665 Lượt xem

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

Ảnh đại diện
Huỷ bỏ

for what will you use this image??

Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Okay,

It's done 

Thank you very much

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 7 25
8744
1
thg 7 25
6504
1
thg 5 25
1038
1
thg 2 25
2702
5
thg 10 24
11836