Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

404 when testing demo xmlrpc client in python

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
pythonxmlrpc
3 Réponses
1829 Vues
Avatar
Mitch Van Looy

Hi everyone,

I am trying to connect to the demo database of Odoo using xmlrpc.client in python but I get 404 errors everytime.

I tried this with python 3.10 and 3.13 on a Mac, and 3.13 on windows and I always get the same results.

I also have tried different networks (work, home and hotspot).


Note sure what I am doing wrong here. This is just the example code from the documentation. 

I have tried searching for this issue, but there is nobody else with this issue apparently.


import xmlrpc.client

info = xmlrpc.client.ServerProxy("https://demo.odoo.com/start").start()

url, db, username, password = info["host"], info["database"], info["user"], info["password"]

common = xmlrpc.client.ServerProxy("{}/xmlrpc/2/common".format(url))

common.version()

 

Traceback (most recent call last):

  File "<python-input-0>", line 5, in <module>

    common.version()

    ~~~~~~~~~~~~~~^^

  File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/xmlrpc/client.py", line 1096, in __call__

    return self.__send(self.__name, args)

           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^

  File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/xmlrpc/client.py", line 1435, in __request

    response = self.__transport.request(

        self.__host,

    ...<2 lines>...

        verbose=self.__verbose

        )

  File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/xmlrpc/client.py", line 1140, in request

    return self.single_request(host, handler, request_body, verbose)

           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/xmlrpc/client.py", line 1170, in single_request

    raise ProtocolError(

    ...<3 lines>...

        )

xmlrpc.client.ProtocolError: <ProtocolError for demo3.odoo.com/xmlrpc/2/common: 404 NOT FOUND>

0
Avatar
Ignorer
Mitch Van Looy
Auteur

Hi,

Thank you for your reply @Cybrosys 

The code I posted, is letter for letter exactly what is published on those pages.

See "test database"and "logging in" (I can't post links because of low karma).

So I still don't know what I am doing wrong here

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Meilleure réponse

Hi,


You can go through the official documentation of Odoo. Please refer to the link below.

https://www.odoo.com/documentation/17.0/th/developer/reference/external_api.html


Hope it helps

1
Avatar
Ignorer
Avatar
Adil Akbar
Meilleure réponse

Hi, please check this: https://youtu.be/Cmbo2iGuTBY 
Hope it helps.

0
Avatar
Ignorer
Avatar
D Enterprise
Meilleure réponse

Hii,


import xmlrpc.client


url = "http://localhost:8069"       # or https://yourdomain.odoo.com if hosted

db = "your_database_name"           # your actual database name

username = "admin"                  # your Odoo username

password = "admin"                  # your Odoo password



common = xmlrpc.client.ServerProxy(f"{url}/xmlrpc/2/common")

uid = common.authenticate(db, username, password, {})

print("Authenticated UID:", uid)


if not uid:

    print("Authentication failed. Check credentials.")

    exit()



models = xmlrpc.client.ServerProxy(f"{url}/xmlrpc/2/object")


# Example: Read the first 5 partners

partner_ids = models.execute_kw(

    db, uid, password,

    'res.partner', 'search',

    [[]],  # empty domain = all records

    {'limit': 5}

)


partners = models.execute_kw(

    db, uid, password,

    'res.partner', 'read',

    [partner_ids],

    {'fields': ['name', 'email']}

)


print("First 5 partners:")

for partner in partners:

    print(f"  {partner['name']} - {partner.get('email', 'No email')}")


please try this code as your work and one example is also there 
i hope it is use full

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Creating journal entries via external API (XML-RPC) Résolu
python xmlrpc
Avatar
1
août 23
15019
XMLRPC Error 302 Temporarily moved (odoo.sh v13)
python xmlrpc
Avatar
0
juin 20
61
Adding translations while creating records for models with XMLRPC
python translations xmlrpc
Avatar
Avatar
1
mai 24
3687
Create invoice via xmlrpc Résolu
python invoice xmlrpc
Avatar
Avatar
1
nov. 22
4160
API attachment question
python api xmlrpc
Avatar
Avatar
Avatar
Avatar
3
juin 22
7563
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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