Odoo Help

0

[V8] How to get DATA_DIR

By
Dorcy Valérian
on 7/15/15, 6:26 AM 1,118 views

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??

Drees Far
on 7/15/15, 8:09 AM
2

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

1
Solanki Shamji
On 7/15/15, 8:20 AM

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.

0
Dorcy Valérian
On 7/15/15, 10:59 AM

Okay,

It's done 

Thank you very much

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 7/15/15, 6:26 AM
Seen: 1118 times
Last updated: 7/15/15, 10:59 AM