Skip to content

Conversation

@sagu-odoo
Copy link
Contributor

@sagu-odoo sagu-odoo commented Dec 23, 2025

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)

@robodoo
Copy link
Contributor

robodoo commented Dec 23, 2025

Pull request status dashboard

@sagu-odoo sagu-odoo requested review from a team and Pirols December 23, 2025 13:22
@sagu-odoo sagu-odoo force-pushed the master-fix-latest-version-sagu branch from 7d582ff to ce6d28d Compare December 23, 2025 13:25
@sagu-odoo
Copy link
Contributor Author

Hello @odoo/upgrade team, can i get review on this ?.

Thanks in advance

Comment on lines 970 to 972
def _caller_version(depth=None):
if depth is None:
depth = 3 if version_gte("16.0") else 2
Copy link
Contributor

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

Suggested change
def _caller_version(depth=None):
if depth is None:
depth = 3 if version_gte("16.0") else 2
def _caller_version(depth=2):

Copy link
Contributor Author

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.

@sagu-odoo sagu-odoo force-pushed the master-fix-latest-version-sagu branch from ce6d28d to 7aa1b58 Compare December 23, 2025 14:35
@sagu-odoo
Copy link
Contributor Author

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)
```
@sagu-odoo sagu-odoo force-pushed the master-fix-latest-version-sagu branch from 7aa1b58 to aea049d Compare December 24, 2025 05:32
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.

3 participants