Commit d95486c1 authored by Tatuya Kamada's avatar Tatuya Kamada

simulation: Mimic to evaluate the Merge request!1097

Original MR message is the folowing.

* *

Fix Expand of Frozen split and defer simulation
Expanding frozen Simulation resulting from a split and Defer raise a NotImplementedError.

It comes from the _extendMovementCollectionDiff function in RuleMixin checking the recorded property "Quantity". The Quantity Split Solver set this variable to zero hence leading the function to consider compensation is needed. This merge request remove the setting of the recorded property quantity on the the split movement. Re-expanding from the root was also removing that recorded property asking the question if this is needed.

As of now system having used Split and defer Quantity will most likely not be able to re-expand their resulting simulation.

A Test is added to validate the fix.

Merge Request !1097
nexedi/erp5!1097/
parent b418885f
......@@ -119,10 +119,10 @@ class QuantitySplitSolver(SolverMixin, ConfigurableMixin, XMLObject):
# record zero quantity property, because this was originally zero.
# without this, splitanddefer after accept decision does not work
# properly.
current_quantity = new_movement.getQuantity()
new_movement.setQuantity(0)
new_movement.recordProperty('quantity')
new_movement.setQuantity(current_quantity)
#current_quantity = new_movement.getQuantity()
#new_movement.setQuantity(0)
#new_movement.recordProperty('quantity')
#new_movement.setQuantity(current_quantity)
start_date = configuration_dict.get('start_date', None)
if start_date is not None:
new_movement.recordProperty('start_date')
......@@ -140,4 +140,4 @@ class QuantitySplitSolver(SolverMixin, ConfigurableMixin, XMLObject):
self, 'succeed'):
self.succeed()
solver_dict["new_movement_list"] = new_movement_list
return solver_dict
\ No newline at end of file
return solver_dict
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