Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

Odoo External API, how can I access the information in my database to extract customer data after a purchase in eCommerce module?

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
purchasedatabasecustomerapiecommerce
2 Risposte
10871 Visualizzazioni
Avatar
Jose Altamirano

Hello, I've been experimenting with API's and connecting to my database, looking through the documentation, I can't seem to find the data related to customer purchases. I'd like to be able to extract information from purchases like NIF, Customer name, product, etc. What's the way to go about it?

0
Avatar
Abbandona
Avatar
Md. Saif Islam
Risposta migliore

In ODOO, you can follow several process. But two of them are more preferable,

1. xmlrpc
2. Rest API

for both options, you have to write a controller or route. Where you can pass you db_name, db_user and password.

then you have to fetch the request and write orm or sql query like this,

cstomer = request.env['res.partner'].search([]), this will return you all the customer info. You can also filter with other attribute if needed. I also share some idea to find it, in both xmlrpc and rest API,

1 Xmlrpc

@http.route('/get_patients', type='json', auth='user')
def get_patients(self):
print("Yes here entered")
patients_rec = request.env['hospital.patient'].search ([])
patients = []
for rec in patients_rec:
false = {
'id': rec.id,
'name': rec.patient_name,
'sequence': rec.name_seq,
'age_group': rec.age_group,
'doctor ': rec.doctor_id.name,
}
patients.append(false)
print("Patient List--->", patients)
data = {'status': 200, 'response': patients, 'message': 'Done All Patients Returned'}
return dates


2. Example of Rest API

@main.validate_token
@http.route('/customers_info', auth='none', type='http')
def fetch_all_customers(self, **payload):
try:
page_no = payload.get('page_no') # ' 5'
if page_no:
page_no = int(page_no)

limit = payload.get('limit')
if limit:
limit = int(limit)

offset = 0
if page_no and limit:
offset = page_no * limit

customers = request.env[' res.partner'].sudo().search([], offset=offset, limit=limit)
data = []
for customer in customers:
cus_id = customer.id
cus_name = customer.name if customer.name else ""
lat = customer.partner_latitude if customer.partner_latitude else ""
lon = customer.partner_longitude if customer.partner_longitude else ""
shop_adrs = customer.contact_address if customer.contact_address else ""
email = customer.email if customer.email else ""
img = str(customer.image_1920) if customer.image_1920 else ""
false = {
'id': cus_id,
'customer_name': cus_name,
'shop_name': cus_name,
'lat': lath,
'lon': lon,
'shop_address': shop_adrs.strip(),
'customer_email': email,
'profile_image': img,
}
data.append(false)
response = dict()
response['success'] = True
response['message'] = ' '
response['customers'] = data
return Response(json.dumps(response), content_type='application/json;charset=utf-8', status=200)
except AccessError as e:
return invalid_response("Access error", "Error: %s" % e.name)


thanks..

0
Avatar
Abbandona
Avatar
Paresh Wagh
Risposta migliore

Hi Jose:

All the Sale data from the website and the backend (except PoS) is stored in the sale.order and sale.order.line models. You should be able to extract the information you need from these models.

0
Avatar
Abbandona
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
How to get psql database access?
database api
Avatar
Avatar
2
set 24
3535
Specify Odoo database in API request
database api
Avatar
0
nov 23
2848
API with multiple database
database api
Avatar
Avatar
1
ott 20
7589
Integration of local and banking payment methods on an e-commerce application
api ecommerce Paiement
Avatar
Avatar
Avatar
Avatar
3
nov 25
2409
Customer on Purchase Order Risolto
purchase customer order
Avatar
Avatar
1
dic 24
2748
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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