From aa788b76a401c00cf2a7d6f19e8e51fc7818049c Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Tue, 14 Mar 2006 15:02:25 +0000
Subject: [PATCH] fixed bug, isDivergent must return 1 if the delivery_ratio is
 equal to 0

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6093 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/SimulationMovement.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/Document/SimulationMovement.py b/product/ERP5/Document/SimulationMovement.py
index 0e7544bd9b..035ee29d3e 100755
--- a/product/ERP5/Document/SimulationMovement.py
+++ b/product/ERP5/Document/SimulationMovement.py
@@ -472,10 +472,12 @@ class SimulationMovement(Movement):
     if d_error is None:
       d_error = 0
     delivery_ratio = self.getDeliveryRatio()
-    #LOG('SimulationMovement.isDivergent d_quantity',0,d_quantity)
-    #LOG('SimulationMovement.isDivergent quantity + d_error',0,quantity + d_error)
+    # if the delivery_ratio is None, make sure that we are
+    # divergent even if the delivery quantity is 0
     if delivery_ratio is not None:
       d_quantity *= delivery_ratio 
+      if delivery_ratio == 0 and quantity >0:
+        return 1
     if d_quantity != quantity + d_error:
       return 1
     return 0  
-- 
2.30.9