odoo connection to external database

When odoo framework default Postgres database access, but in practical application scenarios, it is inevitable to use a different database, it is necessary to study how to connect to other third-party database, here to share relevant module under the OCA, the specific source code here .

I will need to connect the case of third-party database of aggregated into a list as follows:

At present, there are seven modules, base_external_dbsource is the most basic modules, others are dependent on it. Next to MSSQL as an example of the access process point of view odoo.

1. Install required dependencies python

pip install sqlalchemy 
pip install pymssql

2. Installation base_external_dbsource base_external_dbsource_sqlite and base_external_dbsource_mssql module. Corresponding operation interface is shown below

Because here the official layout some of the problems on their own re-publishing the next. MSSQL connector configuration according to FIG pattern string and a corresponding password, the connection test results shown below:

Successful connection to the target database, so you can call this class to access third-party database in odoo modules to carry out their business up.

Guess you like

Origin www.cnblogs.com/yanhuaqiang/p/11527888.html