Is it possible to have direct connectivity of OpenERP DB with Django ? I am able to connect openerp with xmlrpc, but there few custom module tables which I want to modified directly. I am not sure what is right and correct way to direct sql statment for openerp db from django. Is it possible to have openerp db connected as second db on django side, Not sure about this ? I have check this link https://docs.djangoproject.com/en/dev/topics/db/multi-db/#an-example, but not getting exact idea about that. Please help me.
Asked
Active
Viewed 1,275 times
1 Answers
1
You can do it in a pythonic (or django) mode.
Do a introspect to the openERP DDBB and generate the django models with inspectdb (link)
python manage.py inspectdb > models.py
Connect to the DDBB with the multidb django module. Access to data with django models or create raw sql queries.
You have to be careful with this solution.
What about connecting to openERP by REST?. RESTful-openERP

José Ricardo Pla
- 1,043
- 10
- 16
-
Thanks joseripla, I have try to follow steps mention on https://docs.djangoproject.com/en/dev/topics/db/multi-db/#an-example for multiple database, but it seems like system gets hang on after this step : ./manage.py migrate --database=users. My openerp db is on another server. Please check below configuration which i used in my setting file. – user2447747 Jul 17 '14 at 11:38
-
odoo': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'dbname', # Or path to database file if using sqlite3. # The following settings are not used with sqlite3: 'USER': 'username', 'PASSWORD': 'passowrd', 'HOST': '127.0.0.1', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. 'PORT': '8069', # Set to empty string for default. } Where ip is of server ip. ip – user2447747 Jul 17 '14 at 11:39
-
Thanks for your kind support. – user2447747 Jul 17 '14 at 11:41