Commit d9d7829e authored by Romain Courteaud's avatar Romain Courteaud

Bug fix: make proxy field compatible with the method is_required (through the

definition of has_value).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6095 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0fdca6b9
...@@ -186,3 +186,17 @@ class ProxyField(ZMIField): ...@@ -186,3 +186,17 @@ class ProxyField(ZMIField):
if proxy_field is not None: if proxy_field is not None:
result = proxy_field.get_value(id, **kw) result = proxy_field.get_value(id, **kw)
return result return result
security.declareProtected('Access contents information', 'has_value')
def has_value(self, id):
"""
Return true if the field defines such a value.
"""
result = None
if id in self.widget.property_names:
result = ZMIField.has_value(self, id)
else:
proxy_field = self.getTemplateField()
if proxy_field is not None:
result = proxy_field.has_value(id)
return result
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