diff --git a/odoo/addons/base/models/ir_module.py b/odoo/addons/base/models/ir_module.py index 0afa6c0823c..1305833fac7 100644 --- a/odoo/addons/base/models/ir_module.py +++ b/odoo/addons/base/models/ir_module.py @@ -599,6 +599,10 @@ class Module(models.Model): self._cr.commit() registry = modules.registry.Registry.new(self._cr.dbname, update_module=True) self._cr.commit() + if request and request.registry is self.env.registry: + request.env.cr.reset() + request.registry = request.env.registry + assert request.env.registry is registry self._cr.reset() assert self.env.registry is registry diff --git a/odoo/http.py b/odoo/http.py index 2ba32a74840..f496ceca403 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -1723,7 +1723,8 @@ class Request: ir_http._authenticate(rule.endpoint) ir_http._pre_dispatch(rule, args) response = self.dispatcher.dispatch(rule.endpoint, args) - ir_http._post_dispatch(response) + # the registry can have been reniewed by dispatch + self.registry['ir.http']._post_dispatch(response) return response