odoo-ide/pycharm-odoo

Issues with upgrade tools

Closed this issue ยท 2 comments

I know openupgrade from openupgradelib is the to-go tool/package when coding migrations (pre-*.py and/or post-*.py).

venv/bin/pip install -c src/odoo/requirements.txt --upgrade git+https://github.com/OCA/openupgradelib.git@master

But recently I found this in-house tool made by Odoo:
https://www.odoo.com/documentation/17.0/developer/reference/upgrade_utils.html

Which I installed using the same approach as OCA openupgradelib:

venv/bin/pip install -c src/odoo/requirements.txt --upgrade git+https://github.com/odoo/upgrade-util@master

The problem:
image

image

This is the relative to project path ./odoo16e/local/payment_valitorpay/migrations/16.0.1.0.0/pre-migration.py

This is my project structure:
image

When I navigate into odoo.upgrade
image

I end up in ./odoo16e/src/odoo/odoo/upgrade/__init__.py

Is there a way to fix this?

Hi @jcfernandez-890825 ,

I just checked this case. I think PyCharm cannot handle this case by default. I will add a custom import resolution for this case in the Odoo IDE plugin. Stay tuned.

Hi @jcfernandez-890825 ,

The new version 2024.3.0 has been released to address this issue. Happy coding!!!