Commit bde275fb authored by Romain Courteaud's avatar Romain Courteaud

Bug fix: DeliveryBuilder is again able to construct new DeliveryLine which are

movement.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3201 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 51708c96
...@@ -321,10 +321,12 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -321,10 +321,12 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
# 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
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
break break
if delivery_line == None: if delivery_line == None:
...@@ -354,10 +356,12 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -354,10 +356,12 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
delivery_line, delivery_line,
group, group,
self.getDeliveryCellCollectOrderList()[1:], self.getDeliveryCellCollectOrderList()[1:],
{}) {},
update_existing_line=update_existing_line)
def _deliveryCellGroupProcessing(self, delivery_line, movement_group, def _deliveryCellGroupProcessing(self, delivery_line, movement_group,
collect_order_list, property_dict): collect_order_list, property_dict,
update_existing_line=0):
""" """
Build delivery cell from a list of movement on a delivery line Build delivery cell from a list of movement on a delivery line
or complete delivery line or complete delivery line
...@@ -387,12 +391,13 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -387,12 +391,13 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
# Decision can only be made with line matrix range: # Decision can only be made with line matrix range:
# because matrix range can be empty even if line variation category # because matrix range can be empty even if line variation category
# list is not empty # list is not empty
if delivery_line.getCellKeyList(base_id=base_id) == []: if list(delivery_line.getCellKeyList(base_id=base_id)) == []:
# update line # update line
object_to_update = delivery_line object_to_update = delivery_line
if self.testObjectProperties(delivery_line, property_dict): if self.testObjectProperties(delivery_line, property_dict):
# We update a initialized line if update_existing_movement == 1:
update_existing_movement=1 # We update a initialized line
update_existing_movement=1
else: else:
for cell in delivery_line.contentValues( for cell in delivery_line.contentValues(
......
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