Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

How can we display data from another database?

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
developmentdatabaseexternalintegrationpostgresql
4 Antwoorden
37466 Weergaven
Avatar
Moin

We have integrated OpenERP with an external application (Java) which has its own database (Postgres). We want to create a frontend in OpenERP which gets its data from that database and commits any changes we make in OpenERP back to that database. We don't want to import that data in OpenERP database first since there are millions of records to handle and we don't want duplication or massive performance delays. How can this be implemented?

EDIT I essentially want to intercept the data source of the list view and form view to plug my own data in. From the console logs it seems like the search_read method is responsible for acquiring data that is finally displayed, is it possible to plug my own data in that method? Thank You.

3
Avatar
Annuleer
Avatar
Mohammad Alhashash
Beste antwoord

If the external application uses integer primary keys, you can use PostgreSQL Foreign Data Wrapper (doc) to link the external data to the OpenERP database and create new models to access these tables.

You need to have PostgreSQL v9.1 or higher. There are FDWs for many databases and other data sources including PostgreSQL iteself, Oracle, MySQL.

Start by creating foreign tables in the OpenERP database mapped to the external tables/views. OpenERP meta data columns id, create_uid, create_date, write_uid, write_date are required, you can create these columns in a view based on other columns or as a static data and use that view as the model table.

Then, you should create OpenERP models for these tables just like normal models. Each model must have an attribute _table = '_Linked_Table_Name_' to have OpenERP using the linked table instead of creating new one.

Foreign tables are read-only. So, you have to override the create(), write() and unlink() methods to update the original table. Other OpenERP functionality like search should work directly.

If the external table does not have integer id, you may use integer hash function to map the primary key and all foreign keys in other tables to integers (should be 64bit to minimize hash collision probability).

3
Avatar
Annuleer
Moin
Auteur

Thanks for your answer, I looked into experimenting with FDW but I'm stuck as to how shall I go about 'installing' the pgsql_fdw library? There's no download file on the page you linked and google didn't yield any results either. What do I need to do to produce a simple example? Thank You.

Mohammad Alhashash

@Moin What is your operating system and postgresql version?

Moin
Auteur

@Mohammad Ali Ubuntu 12.04, postgresql 9.1 and OpenERP 6.1

Avatar
Yohanes Iwan Sugiarto
Beste antwoord

Maybe you can create fields of type function in an object which will act like a proxy for the other database/external application you have. Just make sure your external database/app is accessible using Python. But this approach would make the fields read only.

If you want to allow changes to be made from OpenERP: Create object with stored fields (not function fields) which mirrors the external database field.

  • Override 'read' method to populate the mirroring fields by reading values from the external database.
  • Override 'write' method to allow changes from OpenERP frontend to be made to external database.

e.g:

def read(self, cr, uid, ids, fields=None, context=None):
    #Populate local fields with values from external database
    res = super(your_proxy_object, self).read(cr, uid, select, fields=fields, context=context)
    return res

def write(self, cr, uid, ids, vals, context=None):
    #Write changes to external database
    return super(your_proxy_object, self).write(cr, uid, ids, vals, context=context)
1
Avatar
Annuleer
Moin
Auteur

This makes perfect sense, I knew about the write method but wasn't aware of the read method. This is exactly what I was looking for, Thank you. Could you please answer the question at http://help.openerp.com/question/1040/how-does-the-orm-read-method-work-exactly/ regarding how to use the read metho

Yohanes Iwan Sugiarto

Sure, I just posted an answer about how the read ORM method work. Just a simple example but I hope it helps.

Avatar
Daniel Reis
Beste antwoord

There is a simple module to access data in foreign databases from OpenERP: base_external_dbsource in branch lp:openobject-extension. I have used it toaccess data from Oracle an SQL Server databases. It should be difficult to extend it to also add write features.

You can find more about in it's manifest.

1
Avatar
Annuleer
René

Hello For testing I installed the module base_external_dbsource and created an externel data source. Connection to my external db is successful, but now I dont know how to use this connection in my custom module. Are there any informations how to use this connection and make the external data available in a module ? Can someone help? René

Avatar
René
Beste antwoord

Hello For testing I installed the module base_external_dbsource and created an externel data source. Connection to my external db is successful, but now I dont know how to use this connection in my custom module. Are there any informations how to use this connection and make the external data available in a module ? Can someone help? René

0
Avatar
Annuleer
Dinesh

Hello René, did you find any solution for this question?

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
How to integrate Microsoft SQL Server with Odoo? Opgelost
server database integration postgresql microsoft
Avatar
Avatar
Avatar
Avatar
5
aug. 24
27389
how to execute pgsql query in odoo to update a particular column from different table? Opgelost
development database postgresql query odoo8
Avatar
Avatar
1
apr. 15
14932
How to reset the development database Opgelost
development database
Avatar
Avatar
Avatar
2
aug. 25
3077
Database Migration
database postgresql
Avatar
Avatar
1
jul. 23
6643
Integration from Rails
external integration
Avatar
Avatar
1
jul. 17
6200
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now