diff options
| author | Moisés López <moylop260@vauxoo.com> | 2019-02-21 08:12:35 +0000 |
|---|---|---|
| committer | Moisés López <moylop260@vauxoo.com> | 2019-03-08 06:53:18 +0000 |
| commit | 72e7976d1ea48515a96304ff75515530e8c63723 (patch) | |
| tree | f223070bb4c899002dbe7af67877a3a5158090a9 /addons/web/static/src/xml/base.xml | |
| parent | ec9fff65305d34c420b86e6a9fc5c04d40c3607a (diff) | |
[FIX] account: Faster read_group for account_abstract_payment._compute_payment_amount
Go to Menu / Accounting / Vendors / Bills
Search a partner with too many opened invoices
- E.g. 713 opened invoices (709 local currency, 4 foreign currency)
Choose all them
Press Open Action -> Register Payment
Wait to open the view.
Before this patch line_profile result
Total time: 1141 s
Line # Hits Time Per Hit % Time Line Contents
================================================================
243 2922 1,139,417,018.0 389944.2 99.9 amount_total = sum([MAP_INVOICE_TYPE_PAYMENT_SIGN[i.type] * i.residual_signed for i in payment_invoices])
After this patch line_profile result
Total time: 12 s
Line # Hits Time Per Hit % Time Line Contents
================================================================
243 2862 11,733,108.0 4099.6 98.1 invoice_datas = invoices.read_group([('id', 'in', invoices.ids)], ['currency_id', 'type', 'residual_signed'], ['currency_id', 'type'], lazy=False)
It means 95x faster
closes odoo/odoo#31313
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
0 files changed, 0 insertions, 0 deletions
