diff --git a/openupgradelib/openupgrade.py b/openupgradelib/openupgrade.py index 731a0a05..903a893b 100644 --- a/openupgradelib/openupgrade.py +++ b/openupgradelib/openupgrade.py @@ -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)]})