Commit 52e24459 authored by Yoshinori Okuji's avatar Yoshinori Okuji

If portal_catalog fails in getting an object, try to get the object from ZODB by list_method.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4103 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ee04b064
...@@ -2068,6 +2068,17 @@ class ListBoxValidator(Validator.Validator): ...@@ -2068,6 +2068,17 @@ class ListBoxValidator(Validator.Validator):
# We must try this # We must try this
# because sometimes, we can be provided bad uids # because sometimes, we can be provided bad uids
o = here.portal_catalog.getObject(uid) o = here.portal_catalog.getObject(uid)
if o is None:
# It is possible that this object is not catalogged yet. So
# the object must be obtained from ZODB.
if not object_list:
list_method = field.get_value('list_method')
list_method = getattr(here, list_method.method_name)
object_list = list_method(REQUEST=REQUEST,**params)
for object in object_list:
if object.getUid() == int(uid):
o = object
break
for sql in editable_column_ids: for sql in editable_column_ids:
alias = '_'.join(sql.split('.')) alias = '_'.join(sql.split('.'))
if '.' in sql: if '.' in sql:
......
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