Commit 984044c4 authored by Guillaume Michon's avatar Guillaume Michon

Some bug fix, and added some reindexing, because divergence status is indexed in catalog


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3334 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cdf1f9fb
...@@ -371,7 +371,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -371,7 +371,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
if collect_order_list != []: if collect_order_list != []:
# Get sorted movement for each delivery line # Get sorted movement for each delivery line
for group in movement_group.getGroupList(): for group in movement_group.getGroupList():
self._deliveryLineGroupProcessing( self._deliveryCellGroupProcessing(
delivery_line, delivery_line,
group, group,
collect_order_list[1:], collect_order_list[1:],
...@@ -397,7 +397,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -397,7 +397,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
# 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):
if update_existing_movement == 1: if update_existing_line == 1:
# We update a initialized line # We update a initialized line
update_existing_movement=1 update_existing_movement=1
...@@ -464,6 +464,10 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -464,6 +464,10 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
# Update simulation movement # Update simulation movement
simulation_movement.setDeliveryValue(delivery_movement) simulation_movement.setDeliveryValue(delivery_movement)
# To update the divergence status, the simulation movement must be reindexed
# and the delivery must be touched.
simulation_movement.immediateReindexObject()
delivery_movement.edit()
# Simulation consistency propagation # Simulation consistency propagation
security.declareProtected(Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
...@@ -519,6 +523,11 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -519,6 +523,11 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
simulation_movement.setDeliveryRatio(mvt_ratio) simulation_movement.setDeliveryRatio(mvt_ratio)
movement.edit(quantity=total_quantity) movement.edit(quantity=total_quantity)
# To update the divergence status, the simulation movements
# must be reindexed, and then the delivery must be touched
for simulation_movement in movement.getDeliveryRelatedValueList():
simulation_movement.immediateReindexObject()
movement.edit()
# Launch delivery creation # Launch delivery creation
if (create_new_delivery == 1) and\ if (create_new_delivery == 1) and\
......
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