Commit 5462e4cc authored by Sebastien Robin's avatar Sebastien Robin

update_requested is not usefull, we should always update lines if we want to update deliveries


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6042 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9778cfe9
...@@ -351,7 +351,6 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -351,7 +351,6 @@ class OrderBuilder(XMLObject, Amount, Predicate):
def _deliveryLineGroupProcessing(self, delivery, movement_group, def _deliveryLineGroupProcessing(self, delivery, movement_group,
collect_order_list, property_dict, collect_order_list, property_dict,
update_requested=0,
activate_kw=None,**kw): activate_kw=None,**kw):
""" """
Build delivery line from a list of movement on a delivery Build delivery line from a list of movement on a delivery
...@@ -364,19 +363,18 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -364,19 +363,18 @@ class OrderBuilder(XMLObject, Amount, Predicate):
for group in movement_group.getGroupList(): for group in movement_group.getGroupList():
self._deliveryLineGroupProcessing( self._deliveryLineGroupProcessing(
delivery, group, collect_order_list[1:], property_dict.copy(), delivery, group, collect_order_list[1:], property_dict.copy(),
update_requested=update_requested,activate_kw=activate_kw) activate_kw=activate_kw)
else: else:
# Test if we can update an existing line, or if we need to create a new # Test if we can update an existing line, or if we need to create a new
# one # one
delivery_line = None delivery_line = None
update_existing_line = 0 update_existing_line = 0
if update_requested==1: for delivery_line_to_update in delivery.contentValues(
for delivery_line_to_update in delivery.contentValues( filter={'portal_type':self.getDeliveryLinePortalType()}):
filter={'portal_type':self.getDeliveryLinePortalType()}): if self.testObjectProperties(delivery_line_to_update, property_dict):
if self.testObjectProperties(delivery_line_to_update, property_dict): delivery_line = delivery_line_to_update
delivery_line = delivery_line_to_update update_existing_line = 1
update_existing_line = 1 break
break
if delivery_line == None: if delivery_line == None:
# Create delivery line # Create delivery line
new_delivery_line_id = str(delivery.generateNewId()) new_delivery_line_id = str(delivery.generateNewId())
......
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