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
- Comptabilitat
- Inventari
- PoS
- Project
- MRP
This question has been flagged
1
Respondre
9065
Vistes
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-se