odoo-ide / pycharm-odoo

PyCharm plugin for Odoo
https://plugins.jetbrains.com/plugin/13499-odoo
Other
41 stars 5 forks source link

Issues with upgrade tools #466

Closed jcfernandez-890825 closed 3 months ago

jcfernandez-890825 commented 3 months ago

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?

trinhanhngoc commented 3 months ago

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.

trinhanhngoc commented 3 months ago

Hi @jcfernandez-890825 ,

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