Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • e-learning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Cervecería
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y soporte técnico
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Explorar todos los sectores
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Servicios para partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

404 when testing demo xmlrpc client in python

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
pythonxmlrpc
3 Respuestas
2036 Vistas
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
Descartar
Mitch Van Looy
Autor

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
Mejor respuesta

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
Descartar
Avatar
Adil Akbar
Mejor respuesta

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

0
Avatar
Descartar
Avatar
D Enterprise
Mejor respuesta

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
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
Creating journal entries via external API (XML-RPC) Resuelto
python xmlrpc
Avatar
1
ago 23
15421
XMLRPC Error 302 Temporarily moved (odoo.sh v13)
python xmlrpc
Avatar
0
jun 20
61
Adding translations while creating records for models with XMLRPC
python translations xmlrpc
Avatar
Avatar
1
may 24
3851
Create invoice via xmlrpc Resuelto
python invoice xmlrpc
Avatar
Avatar
1
nov 22
4307
API attachment question
python api xmlrpc
Avatar
Avatar
Avatar
Avatar
3
jun 22
7804
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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