diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-06-12 19:18:42 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-06-12 19:18:42 +0200 |
| commit | efc64edf704938f442a5ad9bc7e58f2cda3fecda (patch) | |
| tree | 49adee1aa9d2b6d86133c88c3f1131192d711ad7 /odoo/http.py | |
| parent | 6dd58871e1caaa145fcdc227180d43be86020692 (diff) | |
| parent | 242e485b4a28efb620cb0ae87996b10f4cd48747 (diff) | |
[MERGE] forward port branch 11.0 up to 242e485b4a2
Diffstat (limited to 'odoo/http.py')
| -rw-r--r-- | odoo/http.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/odoo/http.py b/odoo/http.py index cadf11bbd28..bcdaf5445e5 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -278,13 +278,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 |
