073b7bb944b5fcb7f978f1f8094e308b9d2bf9a4
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>
…
…
…
…
…
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
Then follow the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%