تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4 الردود
7636 أدوات العرض

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
يوليو 25
8674
1
يوليو 25
6439
1
مايو 25
1002
1
فبراير 25
2542
5
أكتوبر 24
11721