summaryrefslogtreecommitdiff
path: root/addons/l10n_nl
diff options
context:
space:
mode:
authorToufik Ben Jaa <tbe@odoo.com>2019-01-04 09:45:43 +0000
committerToufik Ben Jaa <tbe@odoo.com>2019-01-04 10:55:31 +0000
commit99c319e03a0f08d87bdff95dc0578672fbe89961 (patch)
treedc1098a45f3095914ccadddbfed650a3c04d36cb /addons/l10n_nl
parent033608eb11cff4b983038388e9cba5dd3e02ffac (diff)
[FIX] account: deadlock on install
- When installing an accounting l10n module, the method `try_loading_for_current_company` is called and could cause a deadlock. The deadlock is caused by the fact that if the installation is started via a web request the code tries to retrieve the current user's company by doing `request.env.user.company_id`. This causes issues since the installation code has its own postgresql cursor while calling `request.env.user.company_id` will create its own cursor. So two cursors exists for the same Odoo worker. The installation cursor asks for a lock on `res_users` while the second cursor (the request one) will try to read on `res_users` and wait the first lock to be dropped. The lock is never dropped since the python code isn't running anymore waiting for the `request.env.user.company_id` to be completed. Causing the deadlock. To fix the issue, we avoid the creation/usage of a cursor created by `requesŧ`. So to retrieve the current user's company, we read the user id on the request's session, then browse the `res.user` record with the installation cusror. Fix issue introduced by commit d40956c7909bffa338fd0138565044571e852da3 closes odoo/odoo#29927
Diffstat (limited to 'addons/l10n_nl')
0 files changed, 0 insertions, 0 deletions