Odoo Help


This community 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.


[V8] How to get DATA_DIR

Dorcy Valérian
on 7/15/15, 6:26 AM 639 views


I would like save image in file.

But how can I get the DATA_DIR variable define in openerp-server.conf in my function ?



for what will you use this image??

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

Dhinesh - Technical Consultant, Sodexis Inc

--Dhinesh - Technical Consultant, Sodexis Inc--
| 5 4 9
Pondicherry, India
--Dhinesh - Technical Consultant, Sodexis Inc--

Passionate coder in Python/OpenERP. Knows Django/Flask MVC frameworks. Did code in Java, PHP.

Contact me at: dvdhinesh.mail@gmail.com

Dhinesh - Technical Consultant, Sodexis Inc
On 7/15/15, 9:32 AM

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


Solanki Shamji

--Solanki Shamji--
| 5 2 6
Baroda, India
--Solanki Shamji--


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


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:

You need some python code for achieve this.

May be this will help you.

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


It's done 

Thank you very much

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


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