summaryrefslogtreecommitdiff
path: root/odoo/http.py
diff options
context:
space:
mode:
Diffstat (limited to 'odoo/http.py')
-rw-r--r--odoo/http.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/odoo/http.py b/odoo/http.py
index 886fecc48ba..217720f6a72 100644
--- a/odoo/http.py
+++ b/odoo/http.py
@@ -280,13 +280,15 @@ class WebRequest(object):
_request_stack.pop()
if self._cr:
- if exc_type is None and not self._failed:
- self._cr.commit()
- if self.registry:
- self.registry.signal_changes()
- elif self.registry:
- self.registry.reset_changes()
- self._cr.close()
+ try:
+ if exc_type is None and not self._failed:
+ self._cr.commit()
+ if self.registry:
+ self.registry.signal_changes()
+ elif self.registry:
+ self.registry.reset_changes()
+ finally:
+ self._cr.close()
# just to be sure no one tries to re-use the request
self.disable_db = True
self.uid = None