diff options
| author | Adrian Torres <adt@odoo.com> | 2019-03-12 13:14:26 +0000 |
|---|---|---|
| committer | Arnold Moyaux <arm@odoo.com> | 2019-03-12 15:35:19 +0000 |
| commit | 073b7bb944b5fcb7f978f1f8094e308b9d2bf9a4 (patch) | |
| tree | 89545c11ea3a2c37e3fe0cd908b56e2992d25bed /addons/web/static/src | |
| parent | 859586b641a5ad2b534c8400b69f125215608390 (diff) | |
[FIX] stock: unlink move_lines in batch
Before this patch, cancelling a PO of 2000 lines would take a **very,
very** long time to process... so long that I terminated it before it
finished... yikes.
This was due to the call to `_do_unreserve` on every single move when
calling `_action_cancel`, this meant that n² calls to unlink where being
made (at least), which also meant n² calls to
`stock.move._recompute_state` were being made... that's a lot of
recomputes... = bad performance
The patch simply calls unlink once, which means `_recompute_state` is
called only once, saving a lot of time.
Cancel time for a PO containing 2000 lines:
- Before patch: 1h30min+ (process terminated before finishing)
- After patch: 7min
Other modules making use of stock and `_action_cancel` should also see
benefits from this patch
closes odoo/odoo#31787
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src')
0 files changed, 0 insertions, 0 deletions
