Odoo Help

Welcome!

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.

0

[V8] How to get DATA_DIR

By
Dorcy Valérian
on 7/15/15, 6:26 AM 702 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

Dhinesh - Technical Consultant, Sodexis Inc

--Dhinesh - Technical Consultant, Sodexis Inc--
3577
| 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']

1

Solanki Shamji

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

Hello!

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

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)

Stats

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