diff options
| author | Raphael Collet <rco@odoo.com> | 2017-09-11 14:57:19 +0200 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2017-09-12 09:36:30 +0200 |
| commit | e7205b7992f55ef2cf9df9d8f2b71fafe9ed6348 (patch) | |
| tree | 24f25587dfc1fb1c0ad05cecb3d68264bcbd5160 /odoo/models.py | |
| parent | 984b87c378d0ca48b4f016e600316ea05e9c8eee (diff) | |
[FIX] models: `_in_cache_without` may not return new ids
Diffstat (limited to 'odoo/models.py')
| -rw-r--r-- | odoo/models.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/odoo/models.py b/odoo/models.py index 9c60a0da2bc..996ff54d611 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -4678,7 +4678,9 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})): (:class:`Field` instance), including ``self``. Return at most ``limit`` records. """ - recs = self.browse(self._prefetch[self._name]) - self.env.cache.get_records(self, field) + ids0 = self._prefetch[self._name] + ids1 = set(self.env.cache.get_records(self, field)._ids) + recs = self.browse([it for it in ids0 if it and it not in ids1]) if limit and len(recs) > limit: recs = self + (recs - self)[:(limit - len(self))] return recs |
