[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.
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user