diff options
| author | Olivier Dony <odo@odoo.com> | 2020-10-09 08:11:31 +0000 |
|---|---|---|
| committer | Olivier Dony <odo@odoo.com> | 2020-10-09 10:53:05 +0000 |
| commit | f4b0b517d23ae34d232925d17eb2372863477443 (patch) | |
| tree | 63590fe846c7adddd0d41b4aa9f2217f93d85515 /addons/website/static/src/js | |
| parent | 533a4db8efdf2b16f012e3c9253ae2abc88a344c (diff) | |
[FIX] hr_work_entry: stop shadowing concurrent updates
The `_error_checking()` context manager is used to perform validation
and cleanup after changes on work entries, and is implemented using a
try/finally clause.
This mechanism fails to take into account that the alteration operation
can fail due to a concurrent update (in another transaction). In such a
situation the db cursor becomes instantly invalid, and any attempt to
use it will fail with:
`psycopg2.InternalError: current transaction is aborted`.
This exception will be raised in the `finally` block, and will therefore
discard the original TransactionRollbackException.
The result: instead of being silently retried as expected,
the transaction fails and the user receives a cryptic error message.
Steps to repro: repeatedly click on the button to validate a leave
Solution: specifically handle PostgreSQL `OperationalError` exceptions
and do not attempt to use the cursor when they occur - just let the
exception bubble up.
closes odoo/odoo#59603
X-original-commit: 7ba47e7215df69b6556a848532e4f33ef4243e83
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/website/static/src/js')
0 files changed, 0 insertions, 0 deletions
