Commit 766c5e66 authored by Romain Courteaud's avatar Romain Courteaud

Remove useless feature (movement_list to reindex).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2917 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4820d178
...@@ -183,18 +183,14 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -183,18 +183,14 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
""" """
delivery_module = getattr(self, self.getDeliveryModule()) delivery_module = getattr(self, self.getDeliveryModule())
delivery_list,\ delivery_list = self._deliveryGroupProcessing(
reindexable_movement_list = self._deliveryGroupProcessing(
delivery_module, delivery_module,
movement_group, movement_group,
self.getDeliveryCollectOrderList(), self.getDeliveryCollectOrderList(),
{}) {})
for movement in reindexable_movement_list: for delivery in delivery_list:
# We have to use 'immediate' to bypass the activity tool, delivery.recursiveReindexObject()
# because we will depend on these objects when we try to call
# buildInvoiceList
movement.immediateReindexObject()
return delivery_list return delivery_list
...@@ -204,7 +200,6 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -204,7 +200,6 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
Build empty delivery from a list of movement Build empty delivery from a list of movement
""" """
delivery_list = [] delivery_list = []
reindexable_movement_list = []
# Get current properties from current movement group # Get current properties from current movement group
# And fill property_dict # And fill property_dict
...@@ -214,15 +209,13 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -214,15 +209,13 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
if collect_order_list != []: if collect_order_list != []:
# Get sorted movement for each delivery # Get sorted movement for each delivery
for group in movement_group.getGroupList(): for group in movement_group.getGroupList():
new_delivery_list, \ new_delivery_list = self._deliveryGroupProcessing(
new_reindexable_movement_list = self._deliveryGroupProcessing(
delivery_module, delivery_module,
group, group,
collect_order_list[1:], collect_order_list[1:],
property_dict.copy()) property_dict.copy())
delivery_list.extend(new_delivery_list) delivery_list.extend(new_delivery_list)
reindexable_movement_list.extend(new_reindexable_movement_list)
else: else:
# Create delivery # Create delivery
...@@ -231,11 +224,11 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -231,11 +224,11 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
type_name=self.getDeliveryPortalType(), type_name=self.getDeliveryPortalType(),
id=new_delivery_id) id=new_delivery_id)
# Put properties on delivery # Put properties on delivery
delivery.edit(**property_dict) delivery._edit(**property_dict)
# Then, create delivery line # Then, create delivery line
for group in movement_group.getGroupList(): for group in movement_group.getGroupList():
reindexable_movement_list = self._deliveryLineGroupProcessing( self._deliveryLineGroupProcessing(
delivery, delivery,
group, group,
self.getDeliveryLineCollectOrderList()[1:], self.getDeliveryLineCollectOrderList()[1:],
...@@ -243,9 +236,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -243,9 +236,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
delivery_list.append(delivery) delivery_list.append(delivery)
# XXX temporary return delivery_list
reindexable_movement_list = []
return delivery_list, reindexable_movement_list
def _deliveryLineGroupProcessing(self, delivery, movement_group, def _deliveryLineGroupProcessing(self, delivery, movement_group,
collect_order_list, property_dict): collect_order_list, property_dict):
...@@ -268,7 +259,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -268,7 +259,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
type_name=self.getDeliveryLinePortalType(), type_name=self.getDeliveryLinePortalType(),
id=new_delivery_line_id) id=new_delivery_line_id)
# Put properties on delivery line # Put properties on delivery line
delivery_line.edit(**property_dict) delivery_line._edit(**property_dict)
# Set variation category list on line # Set variation category list on line
line_variation_category_list = [] line_variation_category_list = []
...@@ -283,7 +274,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -283,7 +274,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
# Then, create delivery movement (delivery cell or complete delivery # Then, create delivery movement (delivery cell or complete delivery
# line) # line)
for group in movement_group.getGroupList(): for group in movement_group.getGroupList():
reindexable_movement_list = self._deliveryCellGroupProcessing( self._deliveryCellGroupProcessing(
delivery_line, delivery_line,
group, group,
self.getDeliveryCellCollectOrderList()[1:], self.getDeliveryCellCollectOrderList()[1:],
...@@ -341,7 +332,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -341,7 +332,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
property_dict['price'] = movement.getPrice() property_dict['price'] = movement.getPrice()
# Update properties on object (quantity, price...) # Update properties on object (quantity, price...)
object_to_update.edit(**property_dict) object_to_update._edit(**property_dict)
# Update simulation movement # Update simulation movement
movement._setDeliveryValue(object_to_update) movement._setDeliveryValue(object_to_update)
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