diff --git a/product/ERP5/Document/DeliveryRule.py b/product/ERP5/Document/DeliveryRule.py index 1a37ea22bb6727459cf03915f2bcc761ca1ce2cd..c4ca983a81b06d6b3e76a2d7827bba2771497baa 100644 --- a/product/ERP5/Document/DeliveryRule.py +++ b/product/ERP5/Document/DeliveryRule.py @@ -84,9 +84,11 @@ class DeliveryRule(Rule): portal_type=delivery_movement_type_list) # Check existing movements for movement in applied_rule.contentValues(portal_type=movement_type): - if movement.getLastExpandSimulationState() in \ - (delivery.getPortalDraftOrderStateList() + \ - delivery.getPortalPlannedOrderStateList()): + if movement.getLastExpandSimulationState() not in \ + self.getPortalCurrentInventoryStateList(): + # XXX: This condition is quick and dirty hack - knowing if Simulation + # Movement is frozen shall not be ever hardcoded, this is BPM + # configuration movement_delivery = movement.getDeliveryValue() if not movement._isTreeDelivered(ignore_first=1) and \ movement_delivery not in delivery_movement_list: