You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When upgrading to 17.0 there is new dependency of custom module that I want to install in pre-migration of base module.
But util.modules is not imported correctly in pre- migration but works in post-.
util.modules.module_installed(cr, 'my_custom_module') gives following error
AttributeError: module 'odoo.modules' has no attribute 'module_installed'
My setup is following:
After upgrading the database from 15.0 to 17.0 via python <(curl -s https://upgrade.odoo.com/upgrade) test -d <your db name> -t <target version>
It is restored to continue migration of custom modules.
Everything happens inside docker container.
Odoo is installed at /usr/lib/python3/dist-packages/odoo
Upgrade util is installed at /usr/local/lib/python3.10/dist-packages/odoo/upgrade via sudo -H pip3 install --upgrade git+https://github.com/odoo/upgrade-util@master
Custom upgrade script is located at /mnt/extra-addons/upgrades/base/16.0.1.3/pre-install_new_deps.py
With psql I reset base version (as it is 17.0.1.3 after upgrade.odoo.com) to trigger our upgrade scripts
update ir_module_module set state='to upgrade', latest_version='15.0.1.3'where name='base';
And start odoo
UPG_AUTOINSTALL='all' odoo -u all -d odoo --upgrade-path=/usr/local/lib/python3.10/dist-packages/odoo/upgrade,/mnt/extra-addons/upgrades --stop-after-init
If I set the breakpoint at upgrade script and check util there it can be seen that modules attribute is imported from odoo modules not from util so the script fails.
However it works in base/0.0.0/post-install_new_deps.py for some reason but it's too late for modules operations.
The text was updated successfully, but these errors were encountered:
Hi!
When upgrading to 17.0 there is new dependency of custom module that I want to install in pre-migration of base module.
But
util.modules
is not imported correctly in pre- migration but works in post-.util.modules.module_installed(cr, 'my_custom_module')
gives following errorAttributeError: module 'odoo.modules' has no attribute 'module_installed'
My setup is following:
After upgrading the database from 15.0 to 17.0 via
python <(curl -s https://upgrade.odoo.com/upgrade) test -d <your db name> -t <target version>
It is restored to continue migration of custom modules.
Everything happens inside docker container.
Odoo is installed at
/usr/lib/python3/dist-packages/odoo
Upgrade util is installed at
/usr/local/lib/python3.10/dist-packages/odoo/upgrade
viasudo -H pip3 install --upgrade git+https://github.com/odoo/upgrade-util@master
Custom upgrade script is located at
/mnt/extra-addons/upgrades/base/16.0.1.3/pre-install_new_deps.py
With psql I reset base version (as it is 17.0.1.3 after upgrade.odoo.com) to trigger our upgrade scripts
And start odoo
UPG_AUTOINSTALL='all' odoo -u all -d odoo --upgrade-path=/usr/local/lib/python3.10/dist-packages/odoo/upgrade,/mnt/extra-addons/upgrades --stop-after-init
If I set the breakpoint at upgrade script and check util there it can be seen that modules attribute is imported from odoo modules not from util so the script fails.
However it works in
base/0.0.0/post-install_new_deps.py
for some reason but it's too late for modules operations.The text was updated successfully, but these errors were encountered: