Przejdź do zawartości
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Sztuczna inteligencja
    • IoT
    • VoIP
    • Wiedza
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Sync data from SQL Server db table to Odoo db table

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
schedulersqlsynchronization
3098 Widoki
Awatar
Imran ahmed

I want to sync data table from a SQL server db table to a Odoo database table.

the synchronization should be automatic or there can be an on-click button to sync the data manually.

What are the ways to do this task?

I heard about xmlrpc port, psycopg, and creating a script.  but don't know how  to use them

Need some suggestions

0
Awatar
Odrzuć
Axel Mendoza

I think you should first start learning how to do it using whenever you wanna start with and ask specific questions. Otherwise you wouldn't get any help because your question it's too ambiguous and seems like you wanna others to give you a solution for something unclear

Imran ahmed
Autor

Axel Mendoza, Thanks for your reply.

This is what I have done so far. My objective is to transfer the data from a SQL server to odoo Postgres database automatically. below is my Python script, which will run on scheduled basis.

Now I'm trying to know, what is the industry standard, how are you solving this problem, is there any better way to do this.

import pandas as pd
import pymssql
import psycopg2
import psycopg2.extras

# Function to fetch data from SQL Server data table
def fetch_data_from_sql_server(server, database, username, password, table_name):
connection = pymssql.connect(server=server, database=database, user=username, password=password)
query = f'SELECT TOP 15 CustomerCode,CustomerName,Mobile,Business FROM {table_name};' # Use "TOP 10" to get the first 10 rows
data = pd.read_sql(query, connection)
connection.close()
return data

# Function to insert data into PostgreSQL database
def insert_data_to_postgres(server, database, username, password, table_name, data):
connection_string = f'dbname={database} user={username} password={password} host={server}'
with psycopg2.connect(connection_string) as conn:
data_columns = data.columns.tolist()

# Convert data to a list of tuples to use with psycopg2.extras.execute_values
data_values = [tuple(row) for row in data.to_numpy()]

with conn.cursor() as cur:
for row in data_values:
customer_code = row[0] # Assuming CustomerCode is the first column in the DataFrame
# Check if the CustomerCode exists in the PostgreSQL table
cur.execute(f"SELECT CustomerCode FROM {table_name} WHERE CustomerCode = %s", (customer_code,))
if not cur.fetchone(): # If the customer does not exist, insert the row
insert_query = f"INSERT INTO {table_name} ({', '.join(data_columns)}) VALUES %s"
psycopg2.extras.execute_values(cur, insert_query, [row])

# Commit the changes to the database
conn.commit()

# Configuration for SQL Server
sql_server_config = {
"server": "server_url",
"database": "dbname",
"username": "sa",
"password": "password",
"table_name": "Customer",
}

# Configuration for PostgreSQL
postgres_config = {
"server": "server_url",
"database": "dbname",
"username": "username",
"password": "password",
"table_name": "table_name",
}

# Fetch data from SQL Server
data = fetch_data_from_sql_server(**sql_server_config)

# Insert data into PostgreSQL
insert_data_to_postgres(**postgres_config, data=data)

print("Data transfer completed successfully.")

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
How To Synchronize Localhost Database to online Server Database In odoo pos
synchronization
Awatar
Awatar
Awatar
2
paź 25
6505
Synchronise Database
synchronization
Awatar
Awatar
1
paź 25
5398
Scheduler - Request for Quote creation Rozwiązane
scheduler
Awatar
Awatar
1
mar 24
3630
Usage Of SQl Queries In odoo
sql
Awatar
Awatar
1
lis 22
9365
How to test the bank synchronization in a test environment?
synchronization
Awatar
0
gru 21
35
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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