-
Notifications
You must be signed in to change notification settings - Fork 60
[IMP] util,base: use cursor's mangled names #241
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
upgradeci retry with always only hr |
511a34a
to
e861904
Compare
@@ -20,7 +20,7 @@ def migrate(cr, version): | |||
""" | |||
) | |||
execute_values( | |||
cr._obj, | |||
getattr(cr, '_obj__', None) or cr._obj, |
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.
getattr(cr, '_obj__', None) or cr._obj, | |
cr, |
@@ -1484,7 +1485,7 @@ def update_server_actions_fields(cr, src_model, dst_model=None, fields_mapping=N | |||
) | |||
else: | |||
psycopg2.extras.execute_values( | |||
cr._obj, | |||
getattr(cr, '_obj__') or cr._obj, |
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.
getattr(cr, '_obj__') or cr._obj, | |
cr, |
@@ -1476,7 +1476,7 @@ def replace_record_references_batch(cr, id_mapping, model_src, model_dst=None, r | |||
ignores.append("ir_model_data") | |||
|
|||
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()) |
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.
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
Related to:
odoo/odoo#204273
https://github.com/odoo/enterprise/pull/82655
https://github.com/odoo/upgrade/pull/7478