Bỏ qua để đến Nội dung
Odoo Menu
  • Đăng nhập
  • Dùng thử miễn phí
  • Ứng dụng
    Tài chính
    • Kế toán
    • Hóa đơn
    • Chi phí
    • Bảng tính (BI)
    • Tài liệu
    • Ký tên
    Bán hàng
    • CRM
    • Bán hàng
    • POS Cửa hàng
    • POS Nhà hàng
    • Đăng ký
    • Cho thuê
    Trang web
    • Trình tạo trang web
    • Thương mại điện tử
    • Blog
    • Diễn đàn
    • Trò chuyện trực tiếp
    • Học trực tuyến
    Chuỗi cung ứng
    • Tồn kho
    • Sản xuất
    • PLM
    • Mua hàng
    • Bảo dưỡng
    • Chất lượng
    Nhân sự
    • Nhân viên
    • Tuyển dụng
    • Ngày nghỉ
    • Đánh giá
    • Giới thiệu
    • Đội xe
    Marketing
    • Marketing trên MXH
    • Marketing qua email
    • Marketing qua SMS
    • Sự kiện
    • Tự động hóa Marketing
    • Khảo sát
    Dịch vụ
    • Dự án
    • Bảng chấm công
    • Dịch vụ hiện trường
    • Hỗ trợ
    • Kế hoạch
    • Lịch hẹn
    Năng suất
    • Thảo luận
    • Phê duyệt
    • IoT
    • VoIP
    • Kiến thức
    • WhatsApp
    Ứng dụng của bên thứ ba Studio Odoo Nền tảng Đám mây Odoo
  • Ngành
    Bán lẻ
    • Nhà sách
    • Cửa hàng quần áo
    • Cửa hàng nội thất
    • Cửa hàng tạp hóa
    • Cửa hàng đồ kim khí
    • Cửa hàng đồ chơi
    Ẩm thực & Dịch vụ lưu trú
    • Bar và quán rượu
    • Nhà hàng
    • Đồ ăn nhanh
    • Guest house
    • Nhà phân phối đồ uống
    • Khách sạn
    Bất động sản
    • Công ty môi giới bất động sản
    • Công ty kiến trúc
    • Xây dựng
    • Quản lý bất động sản
    • Làm vườn
    • Hiệp hội chủ sở hữu bất động sản
    Tư vấn
    • Công ty kế toán
    • Đối tác Odoo
    • Công ty marketing
    • Công ty luật
    • Tuyển dụng
    • Thanh tra & chứng nhận
    Sản xuất
    • Dệt may
    • Kim loại
    • Nội thất
    • Ẩm thực
    • Nhà máy bia
    • Quà tặng doanh nghiệp
    Sức khoẻ & fitness
    • CLB thể thao
    • Cửa hàng kính mắt
    • Trung tâm fitness
    • Chuyên gia chăm sóc sức khỏe
    • Hiệu thuốc
    • Tiệm làm tóc
    Thương mại
    • Dịch vụ sửa chữa
    • Phần cứng CNTT & Hỗ trợ
    • Hệ thống năng lượng mặt trời
    • Công ty sản xuất giày
    • Dịch vụ vệ sinh
    • Dịch vụ HVAC
    Khác
    • Tổ chức phi lợi nhuận
    • Cơ quan môi trường
    • Cho thuê biển quảng cáo
    • Nhiếp ảnh
    • Cho thuê xe đạp
    • Đại lý phần mềm
    Xem tất cả ngành
  • Cộng đồng
    Học tập
    • Khóa học
    • Tài liệu
    • Chứng chỉ
    • Đào tạo
    • Blog
    • Podcast
    Thúc đẩy đào tạo
    • Chương trình đào tạo
    • Trò chơi kinh doanh Scale Up!
    • Tham quan Odoo
    Nhận phần mềm
    • Tải xuống
    • So sánh các phiên bản
    • Phiên bản
    Hợp tác
    • Github
    • Diễn đàn
    • Sự kiện
    • Dịch thuật
    • Trở thành đối tác
    • Dịch vụ dành cho Đối tác
    • Đăng ký công ty kế toán của bạn
    Nhận dịch vụ
    • Tìm đối tác
    • Tìm kế toán
    • Gặp chuyên gia hỗ trợ
    • Dịch vụ Triển khai
    • Khách hàng tham khảo
    • Hỗ trợ
    • Nâng cấp
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Nhận một buổi demo
  • Bảng giá
  • Trợ giúp

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

  • CRM
  • e-Commerce
  • Kế toán
  • Tồn kho
  • PoS
  • Dự án
  • MRP
All apps
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Hỗ trợ

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

Đăng ký nhận tin

Nhận thông báo khi có hoạt động trên bài viết này

Câu hỏi này đã bị gắn cờ
2 Trả lời
869 Lượt xem
Ảnh đại diện
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
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
Diego Perona
Tác giả Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!

Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!

Đăng ký
Cộng đồng
  • Khóa học
  • Tài liệu
  • Diễn đàn
Open source
  • Tải xuống
  • Github
  • Runbot
  • Dịch thuật
Dịch vụ
  • Lưu trữ Odoo.sh
  • Hỗ trợ
  • Nâng cấp
  • Phát triển tùy chỉnh
  • Đào tạo
  • Tìm kế toán
  • Tìm đối tác
  • Trở thành đối tác
Giới thiệu công ty
  • Công ty của chúng tôi
  • Tài sản thương hiệu
  • Liên hệ
  • Việc làm
  • Sự kiện
  • Podcast
  • Blog
  • Khách hàng
  • Pháp lý • Riêng tư
  • Bảo mật
الْعَرَبيّة 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 là bộ ứng dụng kinh doanh có open source đáp ứng tất cả các nhu cầu của công ty bạn: CRM, thương mại điện tử, kế toán, tồn kho, POS, quản lý dự án, v.v.

Định hướng giá trị riêng biệt của Odoo là tích hợp hoàn toàn và dễ dàng sử dụng.

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