From 40a82cdfda5e17b5712da46c412a75e0bd7883c3 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 8 Aug 2017 19:14:05 +0200 Subject: [PATCH] [FIX] http: ensure registry is still bound to the request before using it A user can be logged out during a request, loosing the database (and thus registry) information. --- odoo/http.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/odoo/http.py b/odoo/http.py index 338ebb30099..626f43bbea4 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -280,8 +280,9 @@ class WebRequest(object): if self._cr: if exc_type is None and not self._failed: self._cr.commit() - self.registry.signal_changes() - else: + if self.registry: + self.registry.signal_changes() + elif self.registry: self.registry.reset_changes() self._cr.close() # just to be sure no one tries to re-use the request