Commit 0962f70d authored by Sebastien Robin's avatar Sebastien Robin

check last_expand_simulation_state instead of simulation_state


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@770 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1fa0d105
......@@ -134,15 +134,14 @@ An ERP5 Rule..."""
# Get the order when we come from
my_order = applied_rule.getDefaultCausalityValue()
#LOG('Order', 0, str(my_order))
# Only expand if my_order is not None and state is not 'confirmed'
if my_order is not None:
# Only expand order rule if order not yet confirmed (This is consistent
# with the fact that once simulation is launched, we stick to it)
if force or \
(my_order.getSimulationState() not in reserved_inventory_state_list and \
my_order.getSimulationState() not in current_inventory_state_list):
(applied_rule.getLastExpandSimulationState() not in reserved_inventory_state_list and \
applied_rule.getLastExpandSimulationState() not in current_inventory_state_list):
# First, check each contained movement and make
# a list of order ids which do not need to be copied
# eventually delete movement which do not exist anylonger
......@@ -197,6 +196,9 @@ An ERP5 Rule..."""
LOG('ERP5: WARNING', 0, 'AttributeError during expand on order line %s'
% order_line_object.absolute_url())
# Now we can set the last expand simulation state to the current state
applied_rule.setLastExpandSimulationState(my_order.getSimulationState())
# Pass to base class
Rule.expand(self, applied_rule, force=force, **kw)
......
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