summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2016-03-15 14:17:44 +0100
committerRaphael Collet <rco@openerp.com>2016-03-15 14:30:39 +0100
commitddafbab3e44f2fc2a07d31e95a29fa380200d5d6 (patch)
tree4b2272c58325ccf515b2e3c413cbf9b5f6a5b638
parent14436409a33e8e57c4d3a02628a0cc4ac0a89357 (diff)
[FIX] models: do not load custom fields with `depends` when `partial=True`
Upgrading a module in the presence of computed custom fields can fail, if a computed custom field depends on another field from a module that is not loaded yet. The patch simply prevents custom fields with dependencies from being loaded in partial mode.
-rw-r--r--openerp/models.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/openerp/models.py b/openerp/models.py
index 3e350b84d41..d779f487309 100644
--- a/openerp/models.py
+++ b/openerp/models.py
@@ -728,6 +728,8 @@ class BaseModel(object):
attrs['domain'] = eval(field['domain']) if field['domain'] else None
# add compute function if given
if field['compute']:
+ if partial and field['depends']:
+ continue
attrs['compute'] = make_compute(field['compute'], field['depends'])
self._add_field(name, Field.by_type[field['ttype']](**attrs))