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

[FIX] _convert_field_bootstrap_4to5_sql: convert parameters #353

Conversation

chienandalu
Copy link
Member

Fixes #338 (comment)

  • Fix update query
  • Avoid templating the sql directly from the method parameters.

ping @lijoantony

sql = "SELECT id, %s FROM %s " % (field, table)
params = ()
sql = "SELECT id, %s FROM %s "
params = (AsIs(field), AsIs(table))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, this should be sql.Identifier, and built with sql.SQL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

- Fix update query
- Avoid templating the sql directly from the method parameters.
@chienandalu chienandalu force-pushed the openupgrade_160-fix-_convert_field_bootstrap_4to5_sql branch from 626dd0e to 3c51df0 Compare November 13, 2023 16:46
@pedrobaeza pedrobaeza merged commit 1fffdea into OCA:master Nov 13, 2023
3 checks passed
@pedrobaeza pedrobaeza deleted the openupgrade_160-fix-_convert_field_bootstrap_4to5_sql branch November 13, 2023 17:56
@lijoantony
Copy link

Tested. It is working.
Thank you very much!

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