diff options
| author | Laurent Mignon (ACSONE) <laurent.mignon@acsone.eu> | 2020-07-10 10:43:38 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2020-10-20 08:43:02 +0000 |
| commit | 09bf7bd760136ddf55fc7e695a4b6c08d5fc4fed (patch) | |
| tree | 7256c2776168a67c945e17fd4965205c09291354 /debian | |
| parent | 436a94c0335120c2e6f0a91b5c8247e0a787e3a8 (diff) | |
[FIX] core: Ensure that rollback hooks are called when the cursor is closed
Before this change the rollback hooks were never called since rollback() was never explicitely called by the framework. At the end of a transaction, if no error occurs the famework call commit() on the odoo cursor. In all cases, the transaction ends with a call to close(). Into the implementation of _close() rollback() is called on the underlying connection to ensure that not committed changes are rollbacked. That's the reason why despite the fact that rollback() was not called on the Odoo cursor, changes are not committed into the db in case of exception. To keep the same behaviour and avoid to have to explicitely call rollback() on the odoo cursor to trigger the execution of registered rollback hooks, these hooks are now processed in _close(). Since the list of registered hooks is emptied if commit() is called, we are sure that rollback hooks are only executed in case of rollback.
OPW #2294911
closes odoo/odoo#60334
X-original-commit: dce9a05f3a5d37fab711c8ca3c5444941f98e814
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
Diffstat (limited to 'debian')
0 files changed, 0 insertions, 0 deletions
