diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-05-04 16:10:50 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-05-04 16:10:50 +0200 |
| commit | ac63dfc8f48fa6451b4ef94e24e784f252b84f8e (patch) | |
| tree | 768b741e1a34a94b95977d8ff869143aab73617e /odoo/api.py | |
| parent | 62705aee69460457c1b9257ac30363754c60c973 (diff) | |
| parent | 8dade01e2c5b560864291fb3c437ccf5999aee12 (diff) | |
[MERGE] forward port branch 11.0 up to 8dade01e2c5
Diffstat (limited to 'odoo/api.py')
| -rw-r--r-- | odoo/api.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/odoo/api.py b/odoo/api.py index 3f55669023e..d1b1872e7f5 100644 --- a/odoo/api.py +++ b/odoo/api.py @@ -1014,6 +1014,14 @@ class Cache(object): ] return model.browse(ids) + def get_missing_ids(self, records, field): + """ Return the ids of ``records`` that have no value for ``field``. """ + key = field.cache_key(records) + field_cache = self._data[field] + for record_id in records._ids: + if key not in field_cache.get(record_id, ()): + yield record_id + def copy(self, records, env): """ Copy the cache of ``records`` to ``env``. """ src = records |
