Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing DeprecationWarning: distutils Version classes are deprecated. … #5

Open
wants to merge 2 commits into
base: 14.0
Choose a base branch
from

Conversation

dnplkndll
Copy link

…Use packaging.version instead.

As reported in this issue, odoo#83878, when starting the server also in v15 there is an annoying warning as follows

py.warnings odoo/addons/base/models/ir_actions_report.py:73: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
File "./odoo-bin", line 8, in
odoo.cli.main()
File "odoo/cli/command.py", line 61, in main
o.run(args)
File "odoo/cli/server.py", line 176, in run
main(args)
File "odoo/cli/server.py", line 170, in main
rc = odoo.service.server.start(preload=preload, stop=stop)
File "odoo/service/server.py", line 1286, in start
load_server_wide_modules()
File "odoo/service/server.py", line 1196, in load_server_wide_modules
odoo.modules.module.load_openerp_module(m)
File "odoo/modules/module.py", line 396, in load_openerp_module
import('odoo.addons.' + module_name)
File "odoo/addons/base/init.py", line 5, in
from . import models
File "odoo/addons/base/models/init.py", line 13, in
from . import ir_actions_report
File "odoo/addons/base/models/ir_actions_report.py", line 73, in
if LooseVersion(version) >= LooseVersion('0.12.2'):

This commit fixes that.

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@dnplkndll dnplkndll force-pushed the 14.0-packaging_fix_bp branch from 9582de9 to 22d9b30 Compare December 16, 2022 13:05
@ChrisOForgeFlow ChrisOForgeFlow force-pushed the 14.0-packaging_fix_bp branch from 22d9b30 to c58e136 Compare April 6, 2023 16:10
Raúl Martín added 2 commits July 12, 2023 10:53
…Use packaging.version instead.

As reported in this issue, odoo#83878, when starting the server also in v15 there is an annoying warning as follows

py.warnings odoo/addons/base/models/ir_actions_report.py:73: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
File "./odoo-bin", line 8, in <module>
    odoo.cli.main()
  File "odoo/cli/command.py", line 61, in main
    o.run(args)
  File "odoo/cli/server.py", line 176, in run
    main(args)
  File "odoo/cli/server.py", line 170, in main
    rc = odoo.service.server.start(preload=preload, stop=stop)
  File "odoo/service/server.py", line 1286, in start
    load_server_wide_modules()
  File "odoo/service/server.py", line 1196, in load_server_wide_modules
    odoo.modules.module.load_openerp_module(m)
  File "odoo/modules/module.py", line 396, in load_openerp_module
    __import__('odoo.addons.' + module_name)
  File "odoo/addons/base/__init__.py", line 5, in <module>
    from . import models
  File "odoo/addons/base/models/__init__.py", line 13, in <module>
    from . import ir_actions_report
  File "odoo/addons/base/models/ir_actions_report.py", line 73, in <module>
    if LooseVersion(version) >= LooseVersion('0.12.2'):

This commit fixes that.
@ChrisOForgeFlow ChrisOForgeFlow force-pushed the 14.0-packaging_fix_bp branch from c58e136 to 74a901c Compare July 12, 2023 15:53
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