diff options
| author | Christophe Monniez <moc@odoo.com> | 2019-08-26 08:10:18 +0000 |
|---|---|---|
| committer | Christophe Monniez <moc@odoo.com> | 2019-08-26 08:18:40 +0000 |
| commit | cdb904e059a5960b7bf9ee690afdfbedba2e24d1 (patch) | |
| tree | 6bc39dd4aec6c9a47d978aa5acc0729316a89c1a | |
| parent | ff52295c74fc0c31adbe2d990c2a76f84f885876 (diff) | |
[FIX] sql_db: revert ee03fc37704
ee03fc37704 introduced a non deterministic bug by choosing an
environment in a set, so the environment is not always the good one.
closes odoo/odoo#36056
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
| -rw-r--r-- | odoo/sql_db.py | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/odoo/sql_db.py b/odoo/sql_db.py index 4618653efd5..ed5cf07884d 100644 --- a/odoo/sql_db.py +++ b/odoo/sql_db.py @@ -413,17 +413,10 @@ class Cursor(object): def savepoint(self): """context manager entering in a new savepoint""" name = uuid.uuid1().hex - env = next((e for e in Environment.envs if e.cr is self), None) - if env is not None: - env['base'].flush() self.execute('SAVEPOINT "%s"' % name) try: yield - if env is not None: - env['base'].flush() except Exception: - if env is not None: - env.clear() self.execute('ROLLBACK TO SAVEPOINT "%s"' % name) raise else: |
