Commit 2923273d authored by Guillaume Michon's avatar Guillaume Michon

Removed immediateReindexObject() call


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3352 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 920cb544
......@@ -55,13 +55,13 @@ class Distribute(DeliverySolver):
if simulation_quantity != 0:
for simulation_movement in simulation_movement_list:
simulation_movement.setDeliveryRatio(simulation_movement.getCorrectedQuantity() / simulation_quantity)
simulation_movement.immediateReindexObject()
#simulation_movement.immediateReindexObject()
else:
if len(simulation_movement_list) > 0:
delivery_ratio = 1./len(simulation_movement_list)
for simulation_movement in simulation_movement_list:
simulation_movement.setDeliveryRatio(delivery_ratio)
movement.edit()
movement.activate(after_path_and_method_id=([m.getPath() for m in simulation_movement_list], ['immediateReindexObject', 'recursiveImmediateReindexObject'])).edit()
#registerDeliverySolver(Distribute)
......@@ -189,7 +189,7 @@ An ERP5 Rule..."""
simulation_movement.setStartDate(simulation_movement.getStopDate())
if set_ratio:
simulation_movement.setDefaultDeliveryProperties()
simulation_movement.immediateReindexObject()
#simulation_movement.immediateReindexObject()
return modified_properties
def updateSimulationMovement(aggregated_movement, calculated_movement,
......
......@@ -53,5 +53,6 @@ class ProfitAndLoss(CopyToTarget):
added_quantity = movement.getQuantity() - target_quantity
movement.setProfitQuantity(added_quantity)
movement.immediateReindexObject()
# The calling method must edit() the delivery to make an automatic workflow converge
delivery = movement.getDeliveryValue()
if delivery is not None:
delivery.activate(after_path_and_method_id=(movement.getPath(), ['immediateReindexObject', 'recursiveImmediateReindexObject'])).edit()
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