Commit 1db18f63 authored by Aurel's avatar Aurel

_getExplanationUidList should also return documents linked by causality


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30942 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 834a6635
...@@ -38,24 +38,24 @@ import zope.interface ...@@ -38,24 +38,24 @@ import zope.interface
class BusinessPath(Path): class BusinessPath(Path):
""" """
The BusinessPath class embeds all information related to The BusinessPath class embeds all information related to
lead times and parties involved at a given phase of a business lead times and parties involved at a given phase of a business
process. process.
BusinessPath are also used as helper to build deliveries from BusinessPath are also used as helper to build deliveries from
buildable movements. buildable movements.
The idea is to invoke isBuildable() on the collected simulation The idea is to invoke isBuildable() on the collected simulation
movements (which are orphan) during build "after select" process movements (which are orphan) during build "after select" process
Here is the typical code of an alarm in charge of the building process:: Here is the typical code of an alarm in charge of the building process::
builder = portal_deliveries.a_delivery_builder builder = portal_deliveries.a_delivery_builder
for business_path in builder.getDeliveryBuilderRelatedValueList(): for business_path in builder.getDeliveryBuilderRelatedValueList():
builder.build(causality_uid=business_path.getUid(),) # Select movements builder.build(causality_uid=business_path.getUid(),) # Select movements
Pros: global select is possible by not providing a causality_uid Pros: global select is possible by not providing a causality_uid
Cons: global select retrieves long lists of orphan movements which Cons: global select retrieves long lists of orphan movements which
are not yet buildable are not yet buildable
the build process could be rather slow or require activities the build process could be rather slow or require activities
...@@ -224,7 +224,8 @@ class BusinessPath(Path): ...@@ -224,7 +224,8 @@ class BusinessPath(Path):
# that documents are sequenced like simulation movements, which # that documents are sequenced like simulation movements, which
# is wrong # is wrong
for found_explanation in explanation.getCausalityRelatedValueList( for found_explanation in explanation.getCausalityRelatedValueList(
portal_type=self.getPortalDeliveryTypeList()): portal_type=self.getPortalDeliveryTypeList()) + \
explanation.getCausalityValueList():
explanation_uid_list.extend(self._getExplanationUidList( explanation_uid_list.extend(self._getExplanationUidList(
found_explanation)) found_explanation))
return explanation_uid_list return explanation_uid_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