diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-01-15 15:08:01 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-01-15 15:08:01 +0100 |
| commit | 4f2f29953468e4de8aedf73461b0f76dbe1eeca8 (patch) | |
| tree | 3fe8629a74b23b281d392c82500c29a4d77630d5 /odoo | |
| parent | dec9f7c4cec68863c2d4fa82235e3fd2b6def4d5 (diff) | |
| parent | 3374ac805f13ea99c7275c19f2830863382a2960 (diff) | |
[MERGE] forward port branch saas-15 up to 3374ac805f1
Diffstat (limited to 'odoo')
| -rw-r--r-- | odoo/models.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/odoo/models.py b/odoo/models.py index ac5d344b58b..2af09079344 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -2592,14 +2592,16 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})): # retrieve results from records; this takes values from the cache and # computes remaining fields + self = self.with_prefetch(self._prefetch.copy()) data = {record: {'id': record.id} for record in self} missing = set() use_name_get = (load == '_classic_read') for name in (stored + inherited + computed): convert = self._fields[name].convert_to_read - # read every field with prefetching limited to self; this avoids + # restrict the prefetching of self's model to self; this avoids # computing fields on a larger recordset than self - for record in self.with_prefetch(): + self._prefetch[self._name] = set(self._ids) + for record in self: try: data[record][name] = convert(record[name], record, use_name_get) except MissingError: |
