Step to reproduce :
- run a V15 instance
- add a reference to 'OCA/geospatial' repo that doesn't contain any odoo module.
As a result, Odoo will exit with the following error:
odoo-bin: error: option --addons-path: the path '/odoo_env/src/OCA/geospatial' is not a valid addons directory
To avoid such problem, and avoid to have to remove empty repository
(that could become non empty in the future, and contains some migrations scripts),
- we reimplement a version of the odoo function _is_addons_path (odoo/odoo/tools/config.py)
- we add an info log :
Skipping addons path '.../src/env_15.0/src/OCA/geospatial' because it doesn't contain any odoo module.
Previous syntax does not replace correctly the markers in the string.
Using an f-string fix this.
Before:
2024-02-06 10:47:02.303 | WARNING | odoo_openupgrade_wizard.tools.tools_odoo_module:get_odoo_apps_url:359 - Error when trying to get %s: %s
After:
2024-02-07 10:51:11.964 | WARNING | odoo_openupgrade_wizard.tools.tools_odoo_module:get_odoo_apps_url:356 - Error when trying to get https://apps.odoo.com/apps/modules/12.0/partner_contact_address/: Exceeded 30 redirects.
The linting check can be done on any docker image with the latest python
version.
This updates de pre-commit checks and fix file linting to conform to new
standards.