Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

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

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
2 Răspunsuri
867 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Diego Perona
Autor Cel mai bun răspuns

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
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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