diff options
| author | Hugo Adan <hugo@vauxoo.com> | 2019-02-13 16:23:21 +0000 |
|---|---|---|
| committer | Moisés López <moylop260@vauxoo.com> | 2019-02-17 10:27:50 +0000 |
| commit | ce93a949a73f9f17cf1a6ef2b12597c5d2519010 (patch) | |
| tree | e52901a564cd75f3cb0ea2272f49d7237ebe9675 /addons/web/static/tests/fields/basic_fields_mobile_tests.js | |
| parent | 1cb3e7c52251679870c85fb2b4d16a02eddde6af (diff) | |
[REF] account: Performance improve for create_tax_cash_basis_entry
create_tax_cash_basis_entry presents a critical performance issue when
reconciling moves with a lot of account_move_line.
The issue is that `account.move` and `account.move.line` models are triggering computed fields/methods for each new
`account.move.line` added, computing all lines again and again.
Making a factorial performance issue.
For each line the function try create cash basis entries for tax/base lines and this is combined with all the
fields compute that exists on the model so this introduce a performance problem
The issue is that `account.move` and `account.move.line` models are triggering
computed fields/methods for each new `account.move.line` created isolated,
computing all lines again and again.
e.g.
_compute_matched_percentage at
https://github.com/odoo/odoo/blob/5e8289cfeaf52a1eac64bcc975b186f0b5f9594b/addons/account/models/account_move.py#L44-L62
Then for each line created this compute is executed for all lines (not just the last created one).
Now by using self.env.norecompute() and self.recompute() the problem was reduced.
Reconciling an 'account.move' with 1576 lines with a payment takes almost 4
minutes when before this changes, the conciliation process seemed not to never
end.
Fix https://github.com/odoo/odoo/issues/30934
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_mobile_tests.js')
0 files changed, 0 insertions, 0 deletions
