From bef70976292bc9a9069b9c50c21ec5fdd1321fea Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Tue, 12 Jan 2010 10:43:45 +0000
Subject: [PATCH] if original quantity is recorded, we use it to decide if
 update / compensate is required or not.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31703 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/mixin/rule.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/mixin/rule.py b/product/ERP5/mixin/rule.py
index e53249a910..7dd29a96c1 100644
--- a/product/ERP5/mixin/rule.py
+++ b/product/ERP5/mixin/rule.py
@@ -269,7 +269,10 @@ class RuleMixin:
     # First, we update all properties (exc. quantity) which could be divergent
     # and if we can not, we compensate them
     for decision_movement in decision_movement_list:
-      decision_movement_quantity = decision_movement.getQuantity()
+      if decision_movement.isPropertyRecorded('quantity'):
+        decision_movement_quantity = decision_movement.getRecordedProperty('quantity')
+      else:
+        decision_movement_quantity = decision_movement.getQuantity()
       decision_quantity += decision_movement_quantity
       if self._isProfitAndLossMovement(decision_movement):
         if decision_movement.isFrozen():
-- 
2.30.9