Odoo Help


How to fetch external DB data with module base_external_dbsource ?

on 4/19/13, 4:06 AM 2,557 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

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

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.


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)


Asked: 4/19/13, 4:06 AM
Seen: 2557 times
Last updated: 3/16/15, 8:10 AM