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] rename_models: don't call get_model2table #403

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions openupgradelib/openupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,8 +917,8 @@ def rename_models(cr, model_spec):
"""
for (old, new) in model_spec:
logger.info("model %s: renaming to %s", old, new)
_old = get_model2table(old)
_new = get_model2table(new)
_old = old.replace(".", "_")
_new = new.replace(".", "_")
logged_query(
cr,
"UPDATE ir_model SET model = %s WHERE model = %s",
Expand Down Expand Up @@ -1876,6 +1876,8 @@ def get_model2table(model):
"ir.actions.client": "ir_act_client",
"ir.actions.report.xml": "ir_act_report_xml", # model < v11
"ir.actions.report": "ir_act_report_xml", # model >= v11
"mailing.contact.subscription": "mailing_contact_list_rel", # v13 < model < v17
"mail.mass_mailing.list_contact_rel": "mail_mass_mailing_contact_list_rel", # model = v12
}
return model2table.get(model, model.replace(".", "_"))

Expand Down
Loading