diff --git a/product/ERP5Form/ProxyField.py b/product/ERP5Form/ProxyField.py index ea0ef6d3d5409d4ebacd3680deeee310293dd0d3..5bf88f6d13223383f42e991613b15416fd473774 100644 --- a/product/ERP5Form/ProxyField.py +++ b/product/ERP5Form/ProxyField.py @@ -441,11 +441,12 @@ class ProxyField(ZMIField): template_field = field.getTemplateField() if template_field.__class__ != ProxyField: break - if aq_base(template_field) in chain: + template_field_base = aq_base(template_field) + if template_field_base in chain: LOG('ProxyField', WARNING, 'Infinite loop detected in %s.' % '/'.join(self.getPhysicalPath())) return - chain.append(aq_base(template_field)) + chain.append(template_field_base) field = template_field return template_field @@ -691,9 +692,11 @@ class ProxyField(ZMIField): getTransactionalVariable(self)[self._getCacheId()] = field def _getTemplateFieldCache(self): - if self.aq_parent: + parent = self.aq_parent + if parent is not None: + return getTransactionalVariable(self)[self._getCacheId()].__of__(parent) + else: raise KeyError - return getTransactionalVariable(self)[self._getCacheId()].__of__(self.aq_parent) #