odoo/odoo#198542
Created by fw-bot
Merged
at 9460129de983e74d992bce46dfef1f21f66956a1
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team on discord for help.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:saas-18.2-16.0-prefetch-new-lines-rco-417418-fw
- head
- 9e6add74257f9ec56f97d2cd0124254599d2b37d
- merged
- 8 months ago by Framework (ORM), Raphael Collet
| odoo/odoo | |
|---|---|
| 16.0 | #198124 |
| 17.0 | #198202 |
| saas-17.4 | #198443 |
| 18.0 | #198448 |
| saas-18.1 | #198454 |
| saas-18.2 | #198542 |
| saas-18.3 | |
| saas-18.4 | |
| 19.0 | |
| master | #198749 |
[FW][FIX] core: prefetching of secondary new records
Consider a recordset of new records, and a loop like
for record in records:
for line in record.line_ids:
line.value
The implementation of record.line_ids does not actually prefetch all records. It actually fetches the field on the records' origin (their corresponding real records), but only assigns the current new record in cache. As the prefetching relies on the cached values of line_ids, the prefetching mechanism is actually broken on line.
The fix consists in assigning all the records to prefetch in this case. This does not add unexpected prefetching, since the origin records are prefetched as one batch anyway.