Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
274 Visualizações

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

Avatar
Cancelar
Autor Melhor resposta

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.

Avatar
Cancelar
Melhor resposta

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.

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
4
mar. 15
10276
0
jul. 24
1126
3
jun. 20
3750
1
nov. 18
9294
11
fev. 17
63545