diff --git a/openupgradelib/openupgrade.py b/openupgradelib/openupgrade.py
index <HASH>..<HASH> 100644
--- a/openupgradelib/openupgrade.py
+++ b/openupgradelib/openupgrade.py
@@ -736,6 +736,13 @@ def update_module_names(cr, namespec, merge_modules=False):
                  "WHERE module = %s AND name NOT IN "
                  "(SELECT name FROM ir_model_data WHERE module = %s)")
         logged_query(cr, query, (new_name, old_name, new_name))
+        # Rename the remaining occurrences for let Odoo's update process
+        # to auto-remove related resources
+        query = ("UPDATE ir_model_data "
+                 "SET name = name || '_openupgrade_' || id, "
+                 "module = %s"
+                 "WHERE module = %s")
+        logged_query(cr, query, (new_name, old_name))
         query = ("UPDATE ir_module_module_dependency SET name = %s "
                  "WHERE name = %s")
         logged_query(cr, query, (new_name, old_name))
[FIX] update_module_names: Rename non updated XML-ID occurences

Leaving untouched the non update ir.model.data entries, there are
problems loading the database when the migration ends, as some
of the related records can be assets, views...

Renaming the entries to an unique name (generated from ID), we
assure Odoo's update process removed them when updating the target
module. If we would remove it them instead, we will need to remove
manually the related resources as well, so this is the best
strategy.