[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:
Raphael Collet
2016-12-09 09:40:59 +01:00
parent a3f2b8937a
commit 5593d2c89b
+2 -1
View File
@@ -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