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,16 +1207,22 @@ class ListBoxRenderer: ...@@ -1207,16 +1207,22 @@ class ListBoxRenderer:
""" """
form = self.getForm() form = self.getForm()
editable_field_id = '%s_%s' % (self.getUnprefixedId(), alias) editable_field_id = '%s_%s' % (self.getUnprefixedId(), alias)
if form.has_field(editable_field_id, include_disabled=1): field = self.field
return form.get_field(editable_field_id, include_disabled=1) while form is not None:
#Search the editable field in the form
# if we are rendering a proxy field, also look for editable fields from the if form.has_field(editable_field_id, include_disabled=1):
# template field's form.
if self.field.has_value('form_id'):
form = getattr(self.field, self.field.get_value('form_id'), None)
if form and 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 template field's form.
field = field.getTemplateField()
if field is None:
form = None
else:
form = aq_inner(field).aq_parent
else:
form = None
return None return None
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