diff options
| author | Raphael Collet <rco@odoo.com> | 2017-10-11 11:54:19 +0200 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2017-10-11 11:55:02 +0200 |
| commit | 0af8d4ffd26fd08d669cb1a9124110a9b7932a45 (patch) | |
| tree | bb9e030d36831249efdf65ad025f84def571d765 /odoo/fields.py | |
| parent | 02dffa45ae1119c813931c0ed19fa92db3096209 (diff) | |
[FIX] fields: performance optimization
Add a shortcut in `copy_cache`, to avoid iterating on all fields.
Diffstat (limited to 'odoo/fields.py')
| -rw-r--r-- | odoo/fields.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/odoo/fields.py b/odoo/fields.py index 50209746c10..8cc8a748205 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -60,6 +60,8 @@ def copy_cache(records, env): while todo: model_name = next(iter(todo)) record_ids = todo.pop(model_name) - done[model_name] + if not record_ids: + continue done[model_name].update(record_ids) for name, field in src[model_name]._fields.items(): src_cache = src.cache[field] |
