Merge PR #2624 into 16.0

Signed-off-by legalsylvain
pull/2538/merge
OCA-git-bot 2023-05-18 08:28:24 +00:00
commit aa5fc6f30d
1 changed files with 13 additions and 12 deletions

View File

@ -15,18 +15,19 @@ class RegistryPatch(OdooPatch):
method_names = ["init_models"] method_names = ["init_models"]
def init_models(self, cr, model_names, context, install=True): def init_models(self, cr, model_names, context, install=True):
module_name = context["module"] if "module" in context:
_logger.debug("Logging models of module %s", module_name) module_name = context["module"]
upg_registry = current_thread()._upgrade_registry _logger.debug("Logging models of module %s", module_name)
local_registry = {} upg_registry = current_thread()._upgrade_registry
env = api.Environment(cr, SUPERUSER_ID, {}) local_registry = {}
for model in env.values(): env = api.Environment(cr, SUPERUSER_ID, {})
if not model._auto: for model in env.values():
continue if not model._auto:
upgrade_log.log_model(model, local_registry) continue
upgrade_log.compare_registries( upgrade_log.log_model(model, local_registry)
cr, context["module"], upg_registry, local_registry upgrade_log.compare_registries(
) cr, context["module"], upg_registry, local_registry
)
return RegistryPatch.init_models._original_method( return RegistryPatch.init_models._original_method(
self, cr, model_names, context, install=install self, cr, model_names, context, install=install