Commit 6168e710 authored by Fabien Morin's avatar Fabien Morin

model can be None (in case no effective model exists)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28046 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9e288c3b
...@@ -141,10 +141,12 @@ class PaySheetTransaction(Invoice): ...@@ -141,10 +141,12 @@ class PaySheetTransaction(Invoice):
model = self.getSpecialiseValue().getEffectiveModel(\ model = self.getSpecialiseValue().getEffectiveModel(\
start_date=self.getStartDate(), start_date=self.getStartDate(),
stop_date=self.getStopDate()) stop_date=self.getStopDate())
sub_object_list = []
if model is not None:
# if there is an effective model
model_reference_dict = model.getInheritanceReferenceDict( model_reference_dict = model.getInheritanceReferenceDict(
portal_type_list=portal_type_list, portal_type_list=portal_type_list,
property_list=property_list) property_list=property_list)
sub_object_list = []
traverse = self.getPortalObject().unrestrictedTraverse traverse = self.getPortalObject().unrestrictedTraverse
for model_url, id_list in model_reference_dict.items(): for model_url, id_list in model_reference_dict.items():
model = traverse(model_url) model = traverse(model_url)
......
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