Commit dd33d63e authored by Romain Courteaud's avatar Romain Courteaud

ProxyField: explicitely check if ERP5 Form

parent fc65b11f
...@@ -432,14 +432,11 @@ class ProxyField(ZMIField): ...@@ -432,14 +432,11 @@ class ProxyField(ZMIField):
else: else:
proxy_form = getattr(object, form_id, None) proxy_form = getattr(object, form_id, None)
if (proxy_form is not None): if (proxy_form is not None) and (proxy_form.meta_type == 'ERP5 Form'):
field_id = self.get_value('field_id')
try:
proxy_field = proxy_form._getOb(field_id, None)
except AttributeError:
# If the proxy_form is not an ERP5 Form, but a Page Template, # If the proxy_form is not an ERP5 Form, but a Page Template,
# accessing _getOb method fails # accessing _getOb method fails
proxy_field = None field_id = self.get_value('field_id')
proxy_field = proxy_form._getOb(field_id, None)
if proxy_field is None: if proxy_field is None:
if form_id_with_skin_folder_name_flag is False: if form_id_with_skin_folder_name_flag is False:
# Try to get the field from another field library with a lower # Try to get the field from another field library with a lower
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment