summaryrefslogtreecommitdiff
path: root/odoo/http.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-06-17 13:20:35 +0200
committerChristophe Simonis <chs@odoo.com>2019-06-17 13:20:35 +0200
commit25e3f270625b1a7f239d34fab94444d0b676d52e (patch)
treea83ee8f72c2aedbe6c28fc89b6de4a655d5d97e6 /odoo/http.py
parent382989c341935582f6ae47510796ecd8d9f6b710 (diff)
parent48a9f5a6335cfe8b3d465584f0d2f98be2530966 (diff)
[MERGE] forward port branch saas-12.3 up to 48a9f5a6335
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 34af5c78c53..8702fd9a950 100644
--- a/odoo/http.py
+++ b/odoo/http.py
@@ -291,13 +291,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