コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
282 ビュー

✅ CSV Import Works

✅ Importing the same data using a .CSV file works without issue.


❌ XLSX Import Fails

When attempting to import the .XLSX version, the following errors occur:

In Odoo UI (Browser Console Error):
UncaughtClientError > SyntaxError

Uncaught Javascript Error > Failed to execute 'appendChild' on 'Node': Unexpected token '<'

SyntaxError: Failed to execute 'appendChild' on 'Node': Unexpected token '<'

    at DOMEval (web.assets_common.min.js)

    at jQuery.globalEval (...)

    ...

In Odoo Server Log (Backend Error):
ValueError: A string literal cannot contain NUL (0x00) characters.

アバター
破棄
著作者 最善の回答

Hi,

Thank you for the detailed explanation.


I’ve followed your suggested steps, including re-saving the file using Microsoft Excel as an “Excel Workbook (*.xlsx)”, but the issue still persists.


To provide more context:

I’ve backed up both data and code from the main server and restored them to a local environment.

Using the same .xlsx file, the import works perfectly on the local server, but still fails on the main server with the same error.


I would truly appreciate any further suggestions or insights you may have.

アバター
破棄
最善の回答

Hi,

CSV works because it is plain text without special encoding, making it easily readable by Odoo.


XLSX files involve binary structure and XML, which are more prone to format-related issues.


XLSX files created in non-standard editors like LibreOffice or Google Sheets may include non-compliant elements.


Saving as .xls or .ods instead of .xlsx can lead to import errors in Odoo.


Odoo may misinterpret an invalid XLSX file as HTML, causing "Unexpected token '<'" errors in the browser.


Corrupted or improperly encoded XLSX files may contain null (\x00) characters, triggering Python backend errors.


Always open the file in Microsoft Excel to check if it opens without repair warnings.


Use “File > Save As” and select “Excel Workbook (*.xlsx)” format from Excel's save options.


Avoid saving as “Excel 97-2003 Workbook”, “CSV (Macintosh)”, or any other legacy/incompatible format.


After saving correctly, test import using Odoo's built-in Import feature to ensure the format is accepted.


Hope it helps.

アバター
破棄
関連投稿 返信 ビュー 活動
4
3月 15
10281
0
7月 24
1127
3
6月 20
3773
1
11月 18
9304
11
2月 17
63559