Commit 14f46326 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Move the filtering of deliveries by a portal type from the processing code to the caller.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38187 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3825ff74
......@@ -340,6 +340,11 @@ class OrderBuilder(XMLObject, Amount, Predicate):
delivery_select_method = getattr(self, delivery_select_method_id)
for brain in delivery_select_method(movement_list=movement_list):
delivery_to_update_list.append(brain.getObject())
# Make sure that the portal type is good.
delivery_portal_type = self.getDeliveryPortalType()
delivery_to_update_list = [x for x in delivery_to_update_list \
if x.getPortalType() == delivery_portal_type]
else:
delivery_to_update_list = []
# We do not want to update the same object more than twice in one
......@@ -404,8 +409,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
# a new one
delivery_to_update_list = [
x for x in delivery_to_update_list \
if x.getPortalType() == self.getDeliveryPortalType() and \
not self._isUpdated(x, 'delivery')]
if not self._isUpdated(x, 'delivery')]
delivery, property_dict = self._findUpdatableObject(
delivery_to_update_list, movement_group_node_list,
divergence_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