Commit 6ba4b8e1 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

do not try to update existing deliveries if build() is called with update=False explicitly.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34774 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a5ee246e
......@@ -314,7 +314,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
@UnrestrictedMethod
def buildDeliveryList(self, movement_group_node,
delivery_relative_url_list=None,
movement_list=None, **kw):
movement_list=None, update=True, **kw):
"""
Build deliveries from a list of movements
"""
......@@ -326,6 +326,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
# Module where we can create new deliveries
portal = self.getPortalObject()
delivery_module = getattr(portal, self.getDeliveryModule())
if update:
delivery_to_update_list = [portal.restrictedTraverse(relative_url) for \
relative_url in delivery_relative_url_list]
# Deliveries we are trying to update
......@@ -336,6 +337,8 @@ class OrderBuilder(XMLObject, Amount, Predicate):
delivery_to_update_list.extend([sql_delivery.getObject() \
for sql_delivery \
in to_update_delivery_sql_list])
else:
delivery_to_update_list = []
# We do not want to update the same object more than twice in one
# _deliveryGroupProcessing().
self._resetUpdated()
......
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