Skip to content

[FIX] Odoo 20: import convert_xml_import and convert_csv_import from odoo.tools.convert - #468

Open
XtremXpert wants to merge 1 commit into
OCA:masterfrom
XtremXpert:fix-odoo-20
Open

XtremXpert wants to merge 1 commit into
OCA:masterfrom
XtremXpert:fix-odoo-20

Conversation

@XtremXpert

Copy link
Copy Markdown

In Odoo 20 odoo.tools no longer exposes convert_xml_import and convert_csv_import (its __getattr__ raises AttributeError), so openupgrade.load_data() fails at the first noupdate_changes.xml of a 19.0 → 20.0 migration:

  File "openupgradelib/openupgrade.py", line 419, in load_data
    tools.convert_xml_import(
  File "odoo/tools/__init__.py", line 28, in __getattr__
    raise AttributeError(name=name)

Both functions live in odoo.tools.convert since Odoo 16, so import them from there and fall back to odoo.tools for older versions.

Found while writing the 19.0 → 20.0 base migration in OCA/OpenUpgrade.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AjcS4r5UdHtPj73rhfLfJb

…sed by odoo.tools anymore

Import them from odoo.tools.convert, which is where they live since Odoo 16.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AjcS4r5UdHtPj73rhfLfJb

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant