[FIX] fields: detect recursively computed fields when computed together
When several fields are computed together, if one of them depends on another, all the given fields must be considered recursive.
This commit is contained in:
+2
-1
@@ -629,6 +629,7 @@ class Field(object):
|
||||
#
|
||||
|
||||
def _add_trigger(self, env, path_str, field=None):
|
||||
fields = env[self.model_name]._field_computed.get(self) or [self]
|
||||
path = path_str.split('.')
|
||||
# traverse path and add triggers on fields along the way
|
||||
for i, name in enumerate(path):
|
||||
@@ -636,7 +637,7 @@ class Field(object):
|
||||
field = model._fields[name]
|
||||
# env[self.model_name] --- path[:i] --> model with field
|
||||
|
||||
if field is self:
|
||||
if field in fields:
|
||||
self.recursive = True
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user