Commit a1a842b4 authored by Julien Muchembled's avatar Julien Muchembled

Make sure we don't create a Root Applied Rule for a deleted delivery

parent ad12a47e
...@@ -719,7 +719,9 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin, ...@@ -719,7 +719,9 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
def _createRootAppliedRule(self): def _createRootAppliedRule(self):
portal = self.getPortalObject() portal = self.getPortalObject()
# Only create RAR if we are not in a "too early" or "too late" state. # Only create RAR if we are not in a "too early" or "too late" state.
if self.getSimulationState() not in portal.getPortalDraftOrderStateList(): state = self.getSimulationState()
if (state != 'deleted' and
state not in portal.getPortalDraftOrderStateList()):
return super(Delivery, self)._createRootAppliedRule() return super(Delivery, self)._createRootAppliedRule()
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
......
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