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

Custom code: Odoo 17: Import CSV Failed to fetch (VM Local)

Suscribirse

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

Se marcó esta pregunta
2 Respuestas
877 Vistas
Avatar
Diego Perona

Hello everyone,

I'm developing custom modules in Odoo 17 and am encountering a persistent issue when trying to import a CSV file into a custom model. Any help would be greatly appreciated.

Environment Context:

  • Odoo Version: Odoo 17
  • System: Odoo is installed on a Virtual Machine (VM) running Ubuntu Server 22.04.
  • Odoo Access: I access the Odoo web interface (http://localhost:8069) from the Chrome browser, which is also installed and running inside the same Virtual Machine. So, both the browser and the Odoo server are within the same VM environment.
  • Affected Modules: I'm working on a custom module (amazon_catalogs) that defines several models for storing reference data. The issue occurs when attempting to import data into any of these models.
  • Database: I'm working on the Ofituria database.

Detailed Problem Description:

When I try to import a CSV file via the Odoo interface (e.g., in Amazon Catalogs -> Supplier Mapping -> Gear icon -> Import records -> Upload file):

  1. I select the CSV file from the VM's file explorer.
  2. The file explorer closes.
  3. The Odoo screen, where it should preview the data and allow me to map columns, remains blank and unchanged, as if no file was uploaded.
  4. In the browser console (Chrome, inside the VM), the following error is displayed:
    UncaughtPromiseError > TypeError
    Uncaught Promise > Failed to fetch
    TypeError: Failed to fetch
        at Object.post (http://localhost:8069/web/assets/80df7b8/web.assets_web.min.js:2932:30)
        at FileInput.uploadFiles (http://localhost:8069/web/assets/80df7b8/web.assets_web.min.js:2520:32)
        at FileInput.onFileInputChange (http://localhost:8069/web/assets/80df7b8/web.assets_web.min.js:2522:85)
        at Object.mainEventHandler (http://localhost:8069/web/assets/80df7b8/web.assets_web.min.js:1593:77)
        at HTMLInputElement.listener (http://localhost:8069/web/assets/80df7b8/web.assets_web.min.js:748:15)
    

Troubleshooting Steps Already Taken (and Results):

  1. Odoo Server Logs Check: I've monitored the Odoo service logs (sudo journalctl -u odoo.service -f) during the import attempt. No new entries, ERRORs, or WARNINGs appear in the server logs at the time of failure. This strongly suggests the request is not even reaching the server.
  2. Simplified CSV Test: I created a very simple CSV file (just headers and one or two basic data rows, e.g., internal_supplier_code,nationality\nTEST1,ES) with UTF-8 encoding. The error persists.
  3. Incognito Mode: I tried the import in Chrome's incognito mode (within the VM), and the Failed to fetch error still occurs. This rules out browser cache or extension conflicts.

My Current Hypotheses (and Request for Help):

Given that the server doesn't register the request and the issue occurs on the browser side within the same VM, my current suspicions are:

  • Internal VM Firewall (Ubuntu - ufw): Could a local firewall (like ufw) be blocking even localhost communications on that specific port? What specific rules should I check for or apply/disable for testing? I've checked sudo ufw status but am unsure what exactly to look for.
  • VM Resource Limitations: Could the browser be running out of memory or CPU when trying to process the file or the upload request, even for a simple CSV? The VM is allocated 4GB RAM and 2 CPU cores.
  • Subtle CSV File Corruption/Access Issue: Even though a simple CSV failed, could there be a peculiarity in how the browser accesses/reads the file from the VM's filesystem that prevents it from being sent?

Any guidance or suggestions would be greatly appreciated. Thank you in advance!

0
Avatar
Descartar
Avatar
Diego Perona
Autor Mejor respuesta

I'm still stuck with a TypeError: Failed to fetch when trying to import CSV/Excel files into Odoo 17. Critically, both Odoo (the server) and the browser (Chrome/Firefox) are running within the same Virtual Machine (Ubuntu Server 22.04 with a graphical environment), and there are no logs on the Odoo server when the failure occurs. This indicates the request isn't even reaching the server.

I've followed all suggestions and exhausted the main lines of investigation. I'd greatly appreciate any new ideas on what else might be causing this.

What I've tried and ruled out:

  • Browser Issue:
    • Fails in Chrome (TypeError: Failed to fetch in console).
    • Fails in Firefox (fails silently, import screen doesn't advance).
    • Incognito mode/clean profiles tested on both.
    • Ruled out: The problem isn't browser-specific, nor is it extensions/cache.
  • Firewall/Internal Network Issue:
    • ufw is inactive on the VM.
    • /etc/hosts is correct (127.0.0.1 localhost).
    • Loopback (lo) interface restarted and active (127.0.0.1).
    • Odoo listens on 0.0.0.0:8069.
    • Ruled out: Not a firewall block or obvious internal network misconfiguration.
  • Odoo/Server Issue:
    • Odoo server logs (journalctl -u odoo.service -f) show no entries during the import failure.
    • limit_request_body in odoo.conf is set to 100MB.
    • Ruled out: The request isn't reaching the server; Odoo isn't directly responsible for the "fetch" failure.
  • CSV/File Location Issue:
    • Tested with an extremely simple CSV (one data row).
    • Files moved to secure local folders (~/Documents/odoo_csv) within the VM.
    • Ruled out: Not the file content or its location.
  • Graphical Environment/Chrome Launch Issue:
    • While the Missing X server or $DISPLAY error persists when trying to launch Chrome with debugging flags (--disable-web-security), the VM's general graphical environment does work (I use the browser normally from it).
    • Not fully ruled out: The influence of a graphical/permission issue on the browser's interaction with the system during upload is still a possibility, but it's not the obvious root of the "fetch" itself.

Seeking New Ideas:

Since the request dies before even leaving the browser and reaching Odoo, and we've ruled out the most common causes of Failed to fetch, I'm looking for ideas on:

  • Deeper corruption in the VM's network stack that specifically affects POST requests for file uploads from browsers to localhost.
  • Operating system-level permission issues that prevent the browser process from reading the file for upload or performing the network operation, even if standard file permissions look fine.
  • Other low-level services or configurations in Ubuntu Server that might be intercepting or corrupting these requests before they're sent.
  • Any other insights that could explain this behavior in a completely local VM environment.

Any additional perspectives or suggestions for low-level debugging would be highly valuable.

Thanks again for your time and help!

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