Commit 4ce13b11 authored by Alexandre Boeglin's avatar Alexandre Boeglin

* updateAppliedRule: fix comment

* _createAppliedRule: remove wrong block and comment (block was never reached,
  and we should not automatically delete simulation objects)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17723 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7636231a
...@@ -685,9 +685,9 @@ class Delivery(XMLObject, ImmobilisationDelivery): ...@@ -685,9 +685,9 @@ class Delivery(XMLObject, ImmobilisationDelivery):
else: else:
rule_id = rule_reference rule_id = rule_reference
# only expand if we are not in a "too early" or "too late" state
if (self.getSimulationState() not in if (self.getSimulationState() not in
self.getPortalDraftOrderStateList()): self.getPortalDraftOrderStateList()):
# Nothing to do if we are already simulated
self._createAppliedRule(rule_id, force=force, **kw) self._createAppliedRule(rule_id, force=force, **kw)
def _createAppliedRule(self, rule_id, force=0, activate_kw=None, **kw): def _createAppliedRule(self, rule_id, force=0, activate_kw=None, **kw):
...@@ -695,12 +695,6 @@ class Delivery(XMLObject, ImmobilisationDelivery): ...@@ -695,12 +695,6 @@ class Delivery(XMLObject, ImmobilisationDelivery):
Create a new Applied Rule is none is related, or call expand Create a new Applied Rule is none is related, or call expand
on the existing one. on the existing one.
""" """
# Return if draft or cancelled simulation_state
if self.getSimulationState() in ('cancelled',):
# The applied rule should be cleaned up
# ie. empty all movements which have no confirmed children
return
# Otherwise, expand
# Look up if existing applied rule # Look up if existing applied rule
my_applied_rule_list = self.getCausalityRelatedValueList( my_applied_rule_list = self.getCausalityRelatedValueList(
portal_type='Applied Rule') portal_type='Applied Rule')
......
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