-
Notifications
You must be signed in to change notification settings - Fork 82
[FIX] util/modules: fix correct latest version #372
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
base: master
Are you sure you want to change the base?
Conversation
7d582ff to
ce6d28d
Compare
|
Hello @odoo/upgrade team, can i get review on this ?. Thanks in advance |
src/util/modules.py
Outdated
| def _caller_version(depth=None): | ||
| if depth is None: | ||
| depth = 3 if version_gte("16.0") else 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing the version is more costly than doing 1 more iteration
| def _caller_version(depth=None): | |
| if depth is None: | |
| depth = 3 if version_gte("16.0") else 2 | |
| def _caller_version(depth=2): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. I thought it did on purpose.
ce6d28d to
7aa1b58
Compare
|
upgradeci retry with base in all version |
during upgrade because of this in older version latest_version of module assign as modules because last third frame is for older_version is below for fixing this manage depth accordingly. for older version ``` (Pdb) frame.f_back <frame object at 0x5fbaf1938540> (Pdb) from inspect import Parameter, getsourcefile, signature *** ImportError: cannot import name Parameter (Pdb) from inspect import getsourcefile (Pdb) getsourcefile(frame.f_back) '/home/odoo/src/odoo/10.0/odoo/addons/base/maintenance/migrations/util/modules.py' (Pdb) getsourcefile(frame.f_back.f_back) '/home/odoo/src/odoo/10.0/odoo/addons/base/maintenance/migrations/base/9.saas~10.1.3/pre-20-crm_claim.py' (Pdb) getsourcefile(frame.f_back.f_back.f_back) '/home/odoo/src/odoo/10.0/odoo/modules/migration.py' ``` for above 16.0 version: ``` '/tmp/tmpu1jmod5o/migrations/util/modules.py' (Pdb) getsourcefile(frame.f_back.f_back) '/tmp/tmpu1jmod5o/migrations/util/modules.py' (Pdb) getsourcefile(frame.f_back.f_back.f_back) '/tmp/tmpu1jmod5o/migrations/base/saas~15.1.1.3/pre-10-modules.py' ``` before fix: ``` test_9_10.0=> select latest_version from ir_module_module where name='project_issue'; latest_version ---------------- modules (1 row) test_9_10.0=> ``` After fix: ``` test_9_10.0=> select latest_version from ir_module_module where name='project_issue'; latest_version ---------------- 10.0.1.0 (1 row) ```
7aa1b58 to
aea049d
Compare

during upgrade because of this in older version
latest_versionof module assign asmodulesbecause last third frame is for older_version is below for fixing this manage depth accordingly.for older version
for above 16.0 version:
before fix:
After fix: