Commit 337369e8 authored by Julien Muchembled's avatar Julien Muchembled

style

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@37883 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ad05fdb5
...@@ -256,8 +256,8 @@ class ExplanationCache: ...@@ -256,8 +256,8 @@ class ExplanationCache:
path_list = self.getSimulationPathPatternList() path_list = self.getSimulationPathPatternList()
path_list = map(lambda x:x[0:-1], path_list) # Remove trailing % path_list = map(lambda x:x[0:-1], path_list) # Remove trailing %
path_set = set() path_set = set()
for simulation_movement in business_link.\ for simulation_movement in \
_getExplanationRelatedSimulationMovementValueList(self.explanation): self.getBusinessLinkRelatedSimulationMovementValueList(business_link):
simulation_path = simulation_movement.getPath() simulation_path = simulation_movement.getPath()
for path in path_list: for path in path_list:
if simulation_path.startswith(path): if simulation_path.startswith(path):
......
...@@ -112,40 +112,32 @@ class BuilderMixin(XMLObject, Amount, Predicate): ...@@ -112,40 +112,32 @@ class BuilderMixin(XMLObject, Amount, Predicate):
or to Simulation Movements related to a limited set of existing or to Simulation Movements related to a limited set of existing
""" """
# Parameter initialization # Parameter initialization
if movement_relative_url_list is None:
movement_relative_url_list = []
if delivery_relative_url_list is None: if delivery_relative_url_list is None:
delivery_relative_url_list = [] delivery_relative_url_list = []
if movement_list is None:
movement_list = []
# Call a script before building # Call a script before building
self.callBeforeBuildingScript() # XXX-JPS Used ? self.callBeforeBuildingScript() # XXX-JPS Used ?
# Select # Select
if not len(movement_list): if not movement_list:
if len(movement_relative_url_list) == 0: if movement_relative_url_list:
movement_list = map(self.restrictedTraverse,
movement_relative_url_list)
else:
if explanation is not None: if explanation is not None:
explanation_cache = _getExplanationCache(explanation) explanation_cache = _getExplanationCache(explanation)
path = explanation_cache.getSimulationPathPatternList() kw['path'] = explanation_cache.getSimulationPathPatternList()
else:
path = kw.get('path', None)
if business_link is not None: if business_link is not None:
causality_uid = business_link.getUid() kw['causality_uid'] = business_link.getUid()
else: elif kw.get('causality_uid') is None:
causality_uid = kw.get('causality_uid', None)
kw.update(dict(causality_uid=causality_uid, path=path))
if kw.get('causality_uid') is None:
business_link_value_list = self.getRelatedBusinessLinkValueList() business_link_value_list = self.getRelatedBusinessLinkValueList()
if len(business_link_value_list) > 0: if len(business_link_value_list) > 0:
# use only Business Link related movements # use only Business Link related movements
kw['causality_uid'] = [link_value.getUid() for link_value in business_link_value_list] kw['causality_uid'] = [link_value.getUid() for link_value in business_link_value_list]
movement_list = self.searchMovementList( movement_list = self.searchMovementList(
delivery_relative_url_list=delivery_relative_url_list, delivery_relative_url_list=delivery_relative_url_list,
applied_rule_uid=applied_rule_uid,**kw) applied_rule_uid=applied_rule_uid,
else: **kw)
movement_list = [self.restrictedTraverse(relative_url) for relative_url \ if not movement_list:
in movement_relative_url_list] return []
if not len(movement_list):
return []
# Collect # Collect
root_group_node = self.collectMovement(movement_list) root_group_node = self.collectMovement(movement_list)
# Build # Build
......
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