-
- Downloads
[FIX] account: reduce locking on moves
By trying to avoid concurrency issues while assigning the sequence [1], we are locking too many operations even when not in the process of assigning a new number. * when computing `highest_name`, we don't need to lock as this is mostly an information on the form that can possibly change anyway while the form view is open (without any lock anymore) * when computing the accounting date, we don't need to lock, the only information we want is the format of the sequence (yearly, monthly, no reset), which is not likely to change on a same journal. * when changing the `journal_id`, it is only a helper for encoding, if there is a concurrency error it will be shown during the post anyways. Also same argument as for `highest_name` [1] https://github.com/odoo/odoo/commit/ba6ee0b75d66d6f22a592b1b6a7c5158461bec41 closes odoo/odoo#94852 Related: odoo/enterprise#28957 Signed-off-by:Olivier Colson (oco) <oco@odoo.com>
Showing
- addons/account/models/account_move.py 4 additions, 4 deletionsaddons/account/models/account_move.py
- addons/account/models/sequence_mixin.py 13 additions, 11 deletionsaddons/account/models/sequence_mixin.py
- addons/account/tests/test_sequence_mixin.py 96 additions, 49 deletionsaddons/account/tests/test_sequence_mixin.py
- addons/l10n_ar/models/account_move.py 2 additions, 2 deletionsaddons/l10n_ar/models/account_move.py
Loading
Please register or sign in to comment