diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-12-09 15:58:39 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-12-09 15:58:39 +0100 |
| commit | c292202a47dd02f9cc31e5c8784e9393f0499b27 (patch) | |
| tree | dba7c8caff5978908c1783bb7f6741cbce89f5fe /odoo/fields.py | |
| parent | bee407d8d751e22c73070ecb5a37593c6557ee0e (diff) | |
| parent | 18456b9d42769a522adf86183746b49735e9d8b3 (diff) | |
[MERGE] forward port branch 10.0 up to 18456b9
Diffstat (limited to 'odoo/fields.py')
| -rw-r--r-- | odoo/fields.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/odoo/fields.py b/odoo/fields.py index e43c8ddabb6..91865fe1f77 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -925,15 +925,15 @@ class Field(object): for field in fields: for record in records: record._cache[field] = field.convert_to_cache(False, record, validate=False) - with records.env.protecting(fields, records): - if isinstance(self.compute, basestring): - getattr(records, self.compute)() - else: - self.compute(records) + if isinstance(self.compute, basestring): + getattr(records, self.compute)() + else: + self.compute(records) def compute_value(self, records): """ Invoke the compute method on ``records``; the results are in cache. """ - with records.env.do_in_draft(): + fields = records._field_computed[self] + with records.env.do_in_draft(), records.env.protecting(fields, records): try: self._compute_value(records) except (AccessError, MissingError): |
