Skip to content

Commit 4fa4638

Browse files
Update src/odoo_data_flow/import_threaded.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent a6992e1 commit 4fa4638

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/odoo_data_flow/import_threaded.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,8 @@ def _safe_convert_field_value( # noqa: C901
505505
else:
506506
# Non-integer float - leave as-is to let Odoo handle it
507507
return str_value
508-
elif str_value.lstrip("-").isdigit():
509-
# Integer string like "1", "-5"
508+
elif str_value.lstrip("+-").isdigit():
509+
# Integer string like "1", "-5", or "+5"
510510
return int(str_value)
511511
else:
512512
# Non-numeric string - leave as-is
@@ -960,7 +960,8 @@ def _execute_load_batch( # noqa: C901
960960
field_info = model_fields[clean_field_name]
961961
field_type = field_info.get("type", "unknown")
962962

963-
# Sanitize unique ID field values to prevent XML ID constraint violations
963+
# Sanitize unique ID field values to prevent
964+
# XML ID constraint violations
964965
if i == uid_index and value is not None:
965966
converted_value = to_xmlid(str(value))
966967
else:

0 commit comments

Comments
 (0)