Commit 95e4d93a authored by Nicolas Dumazet's avatar Nicolas Dumazet

Syle only: add linebreaks, save indentation to improve readability.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31470 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1fb82d4a
......@@ -561,32 +561,36 @@ class SimulationMovement(Movement, PropertyRecordableMixin):
if self.getDeliveryValue() is not None:
# already delivered
return False
# might be buildable - business path depended
business_path = self.getCausalityValue(portal_type='Business Path')
explanation_value = self.getExplanationValue()
if business_path is not None and explanation_value is not None:
predecessor = business_path.getPredecessorValue()
if predecessor is None:
# first one, can be built
return True
else:
for successor_related in predecessor.getSuccessorRelatedValueList():
for business_path_movement in successor_related \
.getRelatedSimulationMovementValueList(explanation_value):
if successor_related.isMovementRelatedWithMovement(self,
business_path_movement):
business_path_movement_delivery = business_path_movement \
.getDeliveryValue()
if business_path_movement_delivery is None:
return False # related movement is not delivered yet
business_path_movement_delivery_document = \
business_path_movement_delivery.getParentValue()
# here we can optimise somehow, as
# business_path_movement_delivery_document would repeat
if not successor_related.isCompleted(
business_path_movement_delivery_document):
# related movements delivery is not completed
return False
if business_path is None or explanation_value is None:
return True
predecessor = business_path.getPredecessorValue()
if predecessor is None:
# first one, can be built
return True
for successor_related in predecessor.getSuccessorRelatedValueList():
for business_path_movement in successor_related \
.getRelatedSimulationMovementValueList(explanation_value):
if successor_related.isMovementRelatedWithMovement(self,
business_path_movement):
business_path_movement_delivery = business_path_movement \
.getDeliveryValue()
if business_path_movement_delivery is None:
return False # related movement is not delivered yet
business_path_movement_delivery_document = \
business_path_movement_delivery.getParentValue()
# here we can optimise somehow, as
# business_path_movement_delivery_document would repeat
if not successor_related.isCompleted(
business_path_movement_delivery_document):
# related movements delivery is not completed
return False
return True
security.declareProtected( Permissions.ModifyPortalContent,
......
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