Odoo-MSSQL Integration
Odoo-MSSQL Integration

Download and Install:

1. Download SQL Developer from https://www.microsoft.com/en-in/sql-server/sql-server-downloads and install.

2. For the Installation process:-

Refer  https://www.sqlshack.com/step-by-step-installation-of-sql-server-2017/

3. Installed the following add-ons in odoo :-

        3.1 base_external_dbsource

        3.2 base_external_dbsource_mssql.

        3.3 base_external_dbsource_sqlite.

4. Install sqlalchemy and pymssql python libraries.

     Pip install sqlalchemy

     Pip install pymssql and Add “freetds-1.00 “ folder  

5. Go to Settings -> Activate Developer Mode. Go to Settings -> Technical -> Database Sources 

        Create new record for “Test Connection” and give the following:

 


For MS SQL connection string will be like: mssql+pymssql://Username:%s@Servername:dbport/dbname?charset=utf8

Eg:

    mssql+pymssql://DESKTOP-7P5LV44\SKS29:%s@DESKTOP-7P5LV44:1433/MSodoo?charset=utf8

where:  

    DESKTOP-7P5LV44\SKS29  –  User name in MS Sql database

    DESKTOP-7P5LV44 – Servername

    1433 – MS Sql port

    MSodoo – MS Sql database name


6. Save the record and give Test Connection.

        A popup “Test Connection” successful will occur.



For MSSQL Server Connection:

    1. Open MSSQL Server and Create a new database:

        Right Click Database -> New Database. Give Database name eg: SQL_odoo. And click OK.

 

2. Create a new table in MSSQL:

    Right-click Table-> New -> Table. In properties, the window gives the table name.

3. For ColumnName, give Column and give its corresponding Datatype.

    An additional option “Allow Null” is available, which allows a column to allow null values or not. And click Save icon to save the table.

    To Import and Export Tables:

Steps for exporting a table:

1. Right-click the Database and click “Tasks” and select “Export Data”.

2. In SOURCE, select 

        Data Source - “SQL Server Native Client 11.0” .

        Server Name -  Name of the server.

        In Authentication – Give the required server Username and Pwd.

        Database – Select the required database.

3. In DESTINATION, select “Microsoft Excel” and give the path where the export data’s have to be stored.

4. In SPECIFY TABLE COPY OR QUERY, can export all tables, or particular columns by using the query.

5. For selecting a column, (Eg: Select * from sku_master). And click OK for the upcoming columns.

6. The Sku_master column will be exported.


in Odoo
Odoo Web Development
Snippets Manual Configuration