Commit a85acf0c authored by Julien Muchembled's avatar Julien Muchembled

ERP5Form: fix inheritance of editable fields for listboxes whose id != 'listbox'

parent 36162477
...@@ -1306,25 +1306,17 @@ class ListBoxRenderer: ...@@ -1306,25 +1306,17 @@ class ListBoxRenderer:
"""Get an editable field for column, using column alias. """Get an editable field for column, using column alias.
Return None if a field for this column does not exist. Return None if a field for this column does not exist.
""" """
form = self.getForm()
editable_field_id = '%s_%s' % (self.getUnprefixedId(), alias)
field = self.field field = self.field
while form is not None: while True:
#Search the editable field in the form try:
if form.has_field(editable_field_id, include_disabled=1): return field.aq_parent.get_field("%s_%s" % (field.id, alias),
return form.get_field(editable_field_id, include_disabled=1) include_disabled=1)
elif field.meta_type == 'ProxyField': except AttributeError:
if field is None or field.meta_type != 'ProxyField':
break
# if we are rendering a proxy field, also look for editable # if we are rendering a proxy field, also look for editable
# fields from the template field's form. # fields from the template field's form.
field = field.getTemplateField() field = aq_inner(field.getTemplateField())
if field is None:
form = None
else:
form = aq_inner(field).aq_parent
else:
form = None
return None
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