Skip to content

Commit 34bbdc1

Browse files
bosdbosd
authored andcommitted
Fix Odoo server internal errors during import
- Add specific handling for 'tuple index out of range' errors from Odoo server - Log warnings and continue processing instead of crashing - This handles a known bug in some Odoo versions where the server returns internal errors during record creation
1 parent 7294c17 commit 34bbdc1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/odoo_data_flow/import_threaded.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,24 @@ def _create_batch_individually(
533533
continue
534534
except Exception as create_error:
535535
error_str_lower = str(create_error).lower()
536+
537+
# Special handling for Odoo server internal errors
538+
if (
539+
"tuple index out of range" in error_str_lower
540+
and "odoo server error" in error_str_lower
541+
):
542+
log.warning(
543+
f"Odoo server internal error detected during create for "
544+
f"record {source_id}. This is likely a bug in the Odoo server. "
545+
f"Skipping record and continuing with other records."
546+
)
547+
error_message = (
548+
f"Odoo server internal error (tuple index out of range) for record "
549+
f"{source_id}: This is likely a bug in the Odoo server. "
550+
f"See server logs for details."
551+
)
552+
failed_lines.append([*line, error_message])
553+
continue
536554

537555
# Special handling for database connection pool exhaustion errors
538556
if (

0 commit comments

Comments
 (0)