تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
275 أدوات العرض

✅ 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
مارس 15
10276
0
يوليو 24
1126
3
يونيو 20
3751
1
نوفمبر 18
9295
11
فبراير 17
63545