Commit 23ef7549 authored by Jérome Perrin's avatar Jérome Perrin

it's no longer needed to merge getInheritanceModelReferenceDict results with

getReferenceDict results in getInheritedObjectValueList


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20137 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0f879036
...@@ -509,32 +509,14 @@ class PaySheetTransaction(Invoice): ...@@ -509,32 +509,14 @@ class PaySheetTransaction(Invoice):
dependencies) dependencies)
''' '''
model = self.getSpecialiseValue() model = self.getSpecialiseValue()
model_reference_dict = model.getInheritanceModelReferenceDict( model_reference_dict = model.getInheritanceModelReferenceDict(
portal_type_list=portal_type_list) portal_type_list=portal_type_list)
model_dict = model.getReferenceDict(portal_type_list=portal_type_list)
id_list = model_dict.values()
if model_reference_dict.has_key(model.getRelativeUrl()):
model_reference_dict[model.getRelativeUrl()].extend(id_list)
else:
model_reference_dict[model.getRelativeUrl()]=id_list
# get sub objects
key_list = model_reference_dict.keys()
sub_object_list = [] sub_object_list = []
traverse = self.getPortalObject().unrestrictedTraverse
for key in key_list: for model_url, id_list in model_reference_dict.items():
id_list = model_reference_dict[key] model = traverse(model_url)
model = self.getPortalObject().unrestrictedTraverse(key) sub_object_list.extend([model._getOb(x) for x in id_list])
if model is None:
# XXX is it supposed to happen ?
LOG("getInheritedObjectValueList :", 0, "can't find model %s" % key)
for id in id_list:
object = model._getOb(id)
sub_object_list.append(object)
return sub_object_list return sub_object_list
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