odoo/odoo#236341

Created by fw-bot
Merged at 0a6155ac25aae138bdaa5e2e8a6d39c42acd2fe3

Statuses:

label
odoo-dev:saas-18.3-17.0-OOM_compute_tax_country_id-opw-5152687-auma-478100-fw
head
6131449e94a1ff3bc1366905e731a8f2e1e20cc5
merged
9 months ago by Aurélien Marie (auma)
odoo/odoo
17.0 #235749
18.0 #236266
saas-18.2 #236304
saas-18.3 #236341
saas-18.4 #236375
19.0 #236402
saas-19.1
saas-19.2
saas-19.3
saas-19.4
master #236464

[PERF] account: Avoid OOM error when processing batch payments

Description:

When trying to register a payment for multiple invoices, it is possible to trigger an Out Of Memory error. This is caused by the constraint _validate_taxes_country, calling the compute _compute_tax_country_id on all of the moves. To avoid that, we just retrieve the field we need rather than fetching everything.

Reference:

opw-5152687

Forward-Port-Of: #235749