diff options
| author | Simon Lejeune <sle@openerp.com> | 2020-03-12 11:00:14 +0000 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2020-03-12 15:36:03 +0000 |
| commit | d944e67b467f8187aa1988a9f1f1fe8b21e12235 (patch) | |
| tree | 1952d07c000e367a5462990a633ce1f4e0734306 /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | 31db39a0528e059bfa0b839ccba6c56237e8192e (diff) | |
[FIX] stock_account: _action_done performance
Validating a receipt of 90 stock moves having ~300k products in the
database goes from 7 minutes to 11 seconds thanks to the addition of
"active_test=False in the context before doing the searches on valuation
layers.
Most searches on "stock.valuation.layer" are done when validating a
move, but since this model contains an active field, the orm will
pathologically complete the searches expression by adding "id in active"
products. If the list is long, it slows down everything.
Since this field was only added to have a filter on the valuation
reports, it doesn't matter at all to ignore it in "_action_done".
It would probably have been cleaner to just remove the field but it
doesn't fit the stable policy. Nevertheless, we're going to remove the
field in master with task-2178269, as well as this patch.
opw-2209797
closes odoo/odoo#47523
X-original-commit: 466a8319547e11e2193dd8594b0e50e3c27d4b3e
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions
