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.

1

How to fetch external DB data with module base_external_dbsource ?

By
René
on 4/19/13, 4:06 AM 1,895 views

Hello I created an external DB Source with module base_external_dbsource and can connect successfully to that source. But Now I would like to read data from an external source in my custom module and don't now how to use this db-source in my module to read data from external db on the fly. Can someone give me a code-example how to use this db-source in a custom module? Thanks Rene

0

Daniel Reis

--Daniel Reis--
3436
| 6 7 9
Lisbon, Portugal
--Daniel Reis--

Author of the "Odoo Development Essentials" book.

Applications Manager at Securitas Portugal

Github: https://github.com/dreispt

Twitter; @reis_pt


Daniel Reis
On 4/19/13, 5:49 AM

Have a look at the import_odbc module.

Based on that I extracted this code:

db_model = self.pool.get('base.external.dbsource')
res = db_model.execute(cr, uid, [<dbsource_id>], <sql_query>, <sql_params>)
for row in res['rows']:
    print row

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: 4/19/13, 4:06 AM
Seen: 1895 times
Last updated: 3/16/15, 8:10 AM