odoo/upgrade-util#317

Created by Upgrade, Alvaro Fuentes Suarez (afu)
Merged at 13adede3ed38f37030db825c5655172659f94614

Statuses:

Linked pull requests
label
odoo-dev:master-recompute_query-afu
head
a01bb83bc4e3946999d42cd123985253216d0ada
merged
3 months ago by Upgrade, Christophe Simonis (chs)
odoo/upgrade odoo/upgrade-util
master #8426 #317

[IMP] util/orm: `recompute_fields` add query parameter

In most cases when we pass a list of ids to recompute_fields we just run a query to get them. The main downside of this approach is when the list is too big: it can cause MemoryErrors. Instead we can let recompute_fields use a query to get the ids and take the necessary precautions to not fetch millions of entries all at once. As a nice side effect code becomes easier to review since we don't need to check the fetching of ids is done correctly.