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,15 +1307,17 @@ class ListBoxRenderer: ...@@ -1307,15 +1307,17 @@ 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):
return field.aq_parent.get_field("%s_%s" % (field_id, alias),
include_disabled=1) include_disabled=1)
except AttributeError: if field.meta_type != 'ProxyField':
if field is None or field.meta_type != 'ProxyField': return None
break # if we are rendering a proxy field, also look for editable fields from
# if we are rendering a proxy field, also look for editable # the template field's form. This editable field can be prefixed either
# fields from the template field's form. # by the template field listbox id or by the proxy field listbox id.
field = aq_inner(field.getTemplateField()) field = aq_inner(field.getTemplateField())
def getListMethod(self): def getListMethod(self):
......
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