Skip to content

Commit

Permalink
[IMP] rename_fields: minor code improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
duong77476-viindoo committed Jul 17, 2022
1 parent 2c16abd commit 93acdbc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions openupgradelib/openupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,10 @@ def rename_fields(env, field_spec, no_deep=False):
the environment. Not used for now.
"""
cr = env.cr
# Variable used to change field which present in ir.ui.view.custom
# like the one used on dashboard module
dashboard_view_data = env["ir.ui.view.custom"].search([])
if version_info[0] > 9:
# Variable used to change field which present in ir.ui.view.custom
# like the one used on dashboard module
dashboard_view_data = env["ir.ui.view.custom"].search([])
for model, table, old_field, new_field in field_spec:
if column_exists(cr, table, old_field):
rename_columns(cr, {table: [(old_field, new_field)]})
Expand Down

0 comments on commit 93acdbc

Please sign in to comment.