diff options
| author | Raphael Collet <rco@odoo.com> | 2020-04-02 06:45:54 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2020-04-03 11:40:28 +0000 |
| commit | 892e3df7010729da96278becbec29d7fe1f0985d (patch) | |
| tree | 3b62bc4667b3427aa0ccd7ad50311193843017ed /odoo/fields.py | |
| parent | 0551e7ad54bea744fc546682a0070327807d5e36 (diff) | |
[IMP] core: compute field_computed lazily
This is a simple refactoring.
X-original-commit: 634775bff6d9eba9d4548cc801071a942895a719
Diffstat (limited to 'odoo/fields.py')
| -rw-r--r-- | odoo/fields.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/odoo/fields.py b/odoo/fields.py index 2f4764f6233..11ba2836853 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -1044,7 +1044,7 @@ class Field(MetaField('DummyField', (object,), {})): if new_ids: # new records: no business logic new_records = records.browse(new_ids) - with records.env.protecting(records._field_computed.get(self, [self]), records): + with records.env.protecting(records.pool.field_computed.get(self, [self]), records): new_records.modified([self.name]) self.write(new_records, value) if self.relational: @@ -1071,7 +1071,7 @@ class Field(MetaField('DummyField', (object,), {})): env = records.env if self.compute_sudo: records = records.sudo() - fields = records._field_computed[self] + fields = records.pool.field_computed[self] # Just in case the compute method does not assign a value, we already # mark the computation as done. This is also necessary if the compute |
