Commit 8a10405a authored by Yoshinori Okuji's avatar Yoshinori Okuji

Stop calling the same methods many times.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33978 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ba3e06d9
...@@ -287,7 +287,8 @@ class SimulationMovement(Movement, PropertyRecordableMixin): ...@@ -287,7 +287,8 @@ class SimulationMovement(Movement, PropertyRecordableMixin):
"""Returns the delivery if any or the order related to the root """Returns the delivery if any or the order related to the root
applied rule if any. applied rule if any.
""" """
if self.getDeliveryValue() is None: delivery_value = self.getDeliveryValue()
if delivery_value is None:
ra = self.getRootAppliedRule() ra = self.getRootAppliedRule()
order = ra.getCausalityValue() order = ra.getCausalityValue()
if order is not None: if order is not None:
...@@ -296,12 +297,13 @@ class SimulationMovement(Movement, PropertyRecordableMixin): ...@@ -296,12 +297,13 @@ class SimulationMovement(Movement, PropertyRecordableMixin):
# Ex. zero stock rule # Ex. zero stock rule
return ra return ra
else: else:
explanation_value = self.getDeliveryValue() explanation_value = delivery_value
while explanation_value.getPortalType() not in \ portal = self.getPortalObject()
self.getPortalDeliveryTypeList() and \ delivery_type_list = self.getPortalDeliveryTypeList()
explanation_value != self.getPortalObject(): while explanation_value.getPortalType() not in delivery_type_list and \
explanation_value != portal:
explanation_value = explanation_value.getParentValue() explanation_value = explanation_value.getParentValue()
if explanation_value != self.getPortalObject(): if explanation_value != portal:
return explanation_value return explanation_value
# Deliverability / orderability # Deliverability / orderability
......
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