Commit 70c169c1 authored by Xiaowu Zhang's avatar Xiaowu Zhang Committed by Cédric Le Ninivin

RuleMixin: Don't compensate on frozen if quantity is 0

parent 1422a7bb
...@@ -342,6 +342,9 @@ class RuleMixin(Predicate): ...@@ -342,6 +342,9 @@ class RuleMixin(Predicate):
if decision_movement.isFrozen(): if decision_movement.isFrozen():
# Frozen must be compensated # Frozen must be compensated
if not _compare(divergence_tester_list, prevision_movement, decision_movement): if not _compare(divergence_tester_list, prevision_movement, decision_movement):
if not decision_movement_quantity:
# We don't compensate if compensated quantity is 0
continue
new_movement = decision_movement.asContext( new_movement = decision_movement.asContext(
quantity=-decision_movement_quantity) quantity=-decision_movement_quantity)
new_movement.setDelivery(None) new_movement.setDelivery(None)
......
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