[IMP] util,base: use cursor's mangled names#241
Open
tbe-odoo wants to merge 1 commit intoodoo:masterfrom
Open
Conversation
Contributor
Contributor
|
upgradeci retry with always only hr |
511a34a to
e861904
Compare
KangOl
requested changes
Apr 3, 2025
| ) | ||
| execute_values( | ||
| cr._obj, | ||
| getattr(cr, '_obj__', None) or cr._obj, |
Contributor
There was a problem hiding this comment.
Suggested change
| getattr(cr, '_obj__', None) or cr._obj, | |
| cr, |
| else: | ||
| psycopg2.extras.execute_values( | ||
| cr._obj, | ||
| getattr(cr, '_obj__') or cr._obj, |
Contributor
There was a problem hiding this comment.
Suggested change
| getattr(cr, '_obj__') or cr._obj, | |
| cr, |
|
|
||
| cr.execute("CREATE UNLOGGED TABLE _upgrade_rrr(old int PRIMARY KEY, new int)") | ||
| execute_values(cr, "INSERT INTO _upgrade_rrr (old, new) VALUES %s", id_mapping.items()) | ||
| execute_values(getattr(cr, '_obj__', cr), "INSERT INTO _upgrade_rrr (old, new) VALUES %s", id_mapping.items()) |
Contributor
There was a problem hiding this comment.
Suggested change
| execute_values(getattr(cr, '_obj__', cr), "INSERT INTO _upgrade_rrr (old, new) VALUES %s", id_mapping.items()) | |
| execute_values(cr, "INSERT INTO _upgrade_rrr (old, new) VALUES %s", id_mapping.items()) |
- The psycopg2 technical objects are now "dundered" inside the Odoo
cursors.
This is made to avoid using them improperly.
So we must adapt the code to use new names.
Related to:
odoo/odoo#204273
odoo/enterprise#82655
odoo/upgrade#7478
e861904 to
7d124cc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Related to:
odoo/odoo#204273
https://github.com/odoo/enterprise/pull/82655
https://github.com/odoo/upgrade/pull/7478