Commit f1dd114f authored by Jérome Perrin's avatar Jérome Perrin

Listbox: find editable fields contained in field library but prefixed with the proxy field id

One example is listbox_creation_date in most modules
parent a046cd27
...@@ -1307,16 +1307,18 @@ class ListBoxRenderer: ...@@ -1307,16 +1307,18 @@ class ListBoxRenderer:
Return None if a field for this column does not exist. Return None if a field for this column does not exist.
""" """
field = self.field field = self.field
original_field_id = field.id
while True: while True:
try: for field_id in set((original_field_id, field.id)):
return field.aq_parent.get_field("%s_%s" % (field.id, alias), if field.aq_parent.has_field("%s_%s" % (field_id, alias), include_disabled=1):
include_disabled=1) return field.aq_parent.get_field("%s_%s" % (field_id, alias),
except AttributeError: include_disabled=1)
if field is None or field.meta_type != 'ProxyField': if field.meta_type != 'ProxyField':
break return None
# if we are rendering a proxy field, also look for editable # if we are rendering a proxy field, also look for editable fields from
# fields from the template field's form. # the template field's form. This editable field can be prefixed either
field = aq_inner(field.getTemplateField()) # by the template field listbox id or by the proxy field listbox id.
field = aq_inner(field.getTemplateField())
def getListMethod(self): def getListMethod(self):
"""Return the list method object. """Return the list method object.
......
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