Commit b1dcfe05 authored by Romain Courteaud's avatar Romain Courteaud

ERP5Form/ProxyField: do not crash if the proxy_form is not an ERP5 Form

parent 0df6386e
...@@ -432,7 +432,9 @@ class ProxyField(ZMIField): ...@@ -432,7 +432,9 @@ 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'):
# If the proxy_form is not an ERP5 Form, but a Page Template,
# accessing _getOb method fails
field_id = self.get_value('field_id') field_id = self.get_value('field_id')
proxy_field = proxy_form._getOb(field_id, None) proxy_field = proxy_form._getOb(field_id, None)
if proxy_field is None: if proxy_field is None:
......
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