Commit 67d28949 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Fix the code to look up for the last branch, as the previous one did not take...

Fix the code to look up for the last branch, as the previous one did not take branch movement groups into account.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38208 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 33423e6c
...@@ -258,7 +258,22 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -258,7 +258,22 @@ class OrderBuilder(XMLObject, Amount, Predicate):
[DateMovementGroup,PathMovementGroup,...] [DateMovementGroup,PathMovementGroup,...]
""" """
movement_group_list = self.getMovementGroupList() movement_group_list = self.getMovementGroupList()
last_line_movement_group = self.getDeliveryMovementGroupList()[-1]
# Need to find the last branch movement group for separate methods.
last_line_movement_group = None
previous_collect_order_group = None
for movement_group in movement_group_list:
collect_order_group = movement_group.getCollectOrderGroup()
if collect_order_group == 'line':
if previous_collect_order_group == 'delivery' \
or movement_group.isBranch():
last_line_movement_group = movement_group
elif collect_order_group == 'cell':
break
previous_collect_order_group = collect_order_group
if last_line_movement_group is None:
raise CollectError('No branch movement group found at %r' % (self,))
separate_method_name_list = self.getDeliveryCellSeparateOrderList([]) separate_method_name_list = self.getDeliveryCellSeparateOrderList([])
root_group_node = MovementGroupNode( root_group_node = MovementGroupNode(
separate_method_name_list=separate_method_name_list, separate_method_name_list=separate_method_name_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