odoo/odoo#236464

Created by fw-bot
Merged at a9f24a02e91d0a8d6ce31d8a798e367cade06af6

Statuses:

label
odoo-dev:master-17.0-OOM_compute_tax_country_id-opw-5152687-auma-478250-fw
head
e72acae5f80b24476208ba121b125314edfc9598
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