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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
8407
Views
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