Commit 72a60f52 authored by Romain Courteaud's avatar Romain Courteaud

Recursively search the editable_field in the field libraries.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35540 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fc11951e
...@@ -41,7 +41,7 @@ from Products.CMFCore.utils import getToolByName ...@@ -41,7 +41,7 @@ from Products.CMFCore.utils import getToolByName
from Products.ZSQLCatalog.zsqlbrain import ZSQLBrain from Products.ZSQLCatalog.zsqlbrain import ZSQLBrain
from Products.ERP5Type.Message import Message from Products.ERP5Type.Message import Message
from Acquisition import aq_base, aq_self from Acquisition import aq_base, aq_self, aq_inner
import Acquisition import Acquisition
from zLOG import LOG, WARNING from zLOG import LOG, WARNING
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
...@@ -1207,15 +1207,21 @@ class ListBoxRenderer: ...@@ -1207,15 +1207,21 @@ class ListBoxRenderer:
""" """
form = self.getForm() form = self.getForm()
editable_field_id = '%s_%s' % (self.getUnprefixedId(), alias) editable_field_id = '%s_%s' % (self.getUnprefixedId(), alias)
field = self.field
while form is not None:
#Search the editable field in the form
if form.has_field(editable_field_id, include_disabled=1): if form.has_field(editable_field_id, include_disabled=1):
return form.get_field(editable_field_id, include_disabled=1) return form.get_field(editable_field_id, include_disabled=1)
elif field.meta_type == 'ProxyField':
# if we are rendering a proxy field, also look for editable fields from the # if we are rendering a proxy field, also look for editable
# template field's form. # fields from the template field's form.
if self.field.has_value('form_id'): field = field.getTemplateField()
form = getattr(self.field, self.field.get_value('form_id'), None) if field is None:
if form and form.has_field(editable_field_id, include_disabled=1): form = None
return form.get_field(editable_field_id, include_disabled=1) else:
form = aq_inner(field).aq_parent
else:
form = None
return None return 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