From 6479bd499d26fff60e421184010a1e223bd87578 Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Tue, 16 Mar 2010 10:26:11 +0000
Subject: [PATCH] Have get_recursive_tales to raise a verbose exception when a
 template field may not be retrieved.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33752 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/ProxyField.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/product/ERP5Form/ProxyField.py b/product/ERP5Form/ProxyField.py
index 8cbae6cc4d..836ec5ddde 100644
--- a/product/ERP5Form/ProxyField.py
+++ b/product/ERP5Form/ProxyField.py
@@ -552,6 +552,8 @@ class ProxyField(ZMIField):
       return self.get_tales(id)
     else:
       proxied_field = self.getTemplateField()
+      if proxied_field is None:
+        raise AttributeError('The proxy field %r cannot find a template field' % self)
       if proxied_field.__class__ == ProxyField:
         return proxied_field.get_recursive_tales(id)
       else:
-- 
2.30.9