Odoo Help

0

Is there a way to connect to SQL Server Database from an odoo module?

By
Cole
on 4/23/15, 6:08 AM 3,374 views

Hello, I need to create a module which import data from SQL Server.

I already made the code in python which connects to SQL Server using pyodbc and insert data via API (using XML-RPC library). But this code is physically on my PC and when i have to import data from another PC, I need to install python first and then execute it. I want to integrate this in a odoo module, but i'm not sure if there's a way to connect to SQL Server from online.

Any help or tip would be appreciated.


1
BISSTECH SRL
On 4/23/15, 3:05 PM

Hi, for this you need a small custom module for Odoo. In your module, you should create a wizard that lets the user to select/input the information needed for the import of the data from SQL Server. In the method linked to the submit button of the wizard, call the importing code (pyodbc). For the insertion into Odoo, you might want to re-write you XML-RPC code used in the current client with server specific code for creating the records. Surely, you could use for this last step SQL statements directly, but it is not advisable. If you need more details for the custom module or for the wizard, please let me know.

I hope this helps! If it does, please up-vote the answer. Best, BISS

0
Cole
On 4/24/15, 9:27 AM

Thank you, it helped me a lot but i have problems with pyodbc. I can use xmlrpclib without any problem, but can't do the same with pyodbc because the module crashes everytime I try to import the library. Where should i put pyodbc files to make odoo recognise it?

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.

Register

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)

Stats

Asked: 4/23/15, 6:08 AM
Seen: 3374 times
Last updated: 4/24/15, 9:27 AM