summaryrefslogtreecommitdiff
path: root/odoo/http.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-06-14 10:15:49 +0200
committerChristophe Simonis <chs@odoo.com>2019-06-14 10:15:49 +0200
commit5b2f64fd5d581b9e581c1a3c85ad586fd45cccd8 (patch)
tree75cced62285d3698e870862ac23bf9a0abbece52 /odoo/http.py
parented7b3b0fa40871b34cfd036d9be7b2a3f223fe19 (diff)
parent4870251f0b0b0503b526b367827ac186ae1fbefd (diff)
[MERGE] forward port branch 12.0 up to 4870251f0b0
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