Commit 2db41b1d authored by Nicolas Dumazet's avatar Nicolas Dumazet

The benefits of this "optimization" is not obvious as

 BusinessPath.isCompleted calls are quite expensive

Removing it with the previous improvements actually leads
to before performance.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36586 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2acbb2c1
......@@ -585,6 +585,7 @@ class SimulationMovement(Movement, PropertyRecordableMixin):
causality = parent_path.getRelativeUrl()
related_simulation_list = causality_dict.get(causality, [])
completed_state_list = parent_path.getCompletedStateList()
for business_path_movement in related_simulation_list:
if parent_path.isMovementRelatedWithMovement(self,
business_path_movement):
......@@ -592,14 +593,7 @@ class SimulationMovement(Movement, PropertyRecordableMixin):
.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.getExplanationValue()
# here we can optimise somehow, as
# business_path_movement_delivery_document would repeat
if not parent_path.isCompleted(
business_path_movement_delivery_document):
# related movements delivery is not completed
if business_path_movement.getSimulationState() not in completed_state_list:
return False
return True
......
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