From be4107a5b9280df0584551a9660e32930daf7654 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Wed, 23 Dec 2009 13:13:18 +0000
Subject: [PATCH] store original value as simulation movement's recorded
 property instead of modifying the original order line.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31439 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testPackingList.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/product/ERP5/tests/testPackingList.py b/product/ERP5/tests/testPackingList.py
index 4d9bb1fe17..a11c1c0429 100644
--- a/product/ERP5/tests/testPackingList.py
+++ b/product/ERP5/tests/testPackingList.py
@@ -515,8 +515,8 @@ class TestPackingListMixin(TestOrderMixin):
     simulation_line_list = applied_rule.objectValues()
 #    self.assertEquals(len(simulation_line_list),1)
     for simulation_line in simulation_line_list:
+      simulation_line.recordProperty('quantity')
       simulation_line.edit(quantity=self.default_quantity-1)
-      simulation_line.getOrderValue().edit(quantity=self.default_quantity-1)
 
   def stepModifySimulationLineQuantityForMergedLine(self,sequence=None, sequence_list=None, **kw):
     """
@@ -526,8 +526,8 @@ class TestPackingListMixin(TestOrderMixin):
     simulation_line_list = applied_rule.objectValues()
     self.assertEquals(len(simulation_line_list),2)
     for simulation_line in simulation_line_list:
+      simulation_line.recordProperty('quantity')
       simulation_line.edit(quantity=self.default_quantity-1)
-      simulation_line.getOrderValue().edit(quantity=self.default_quantity-1)
 
   def stepModifySimulationLineStartDate(self,sequence=None, sequence_list=None, **kw):
     """
@@ -537,8 +537,8 @@ class TestPackingListMixin(TestOrderMixin):
     simulation_line_list = applied_rule.objectValues()
     resource_list = sequence.get('resource_list')
     for simulation_line in simulation_line_list:
+      simulation_line.recordProperty('start_date')
       simulation_line.edit(start_date=self.datetime+15)
-      simulation_line.getOrderValue().edit(start_date=self.datetime+15)
 
   def stepModifyOneSimulationLineStartDate(self,sequence=None, sequence_list=None, **kw):
     """
@@ -548,8 +548,8 @@ class TestPackingListMixin(TestOrderMixin):
     simulation_line_list = applied_rule.objectValues()
     resource_list = sequence.get('resource_list')
     self.assertEquals(len(simulation_line_list),len(resource_list))
+    simulation_line_list[-1].recordProperty('start_date')
     simulation_line_list[-1].edit(start_date=self.datetime+15)
-    simulation_line_list[-1].getOrderValue().edit(start_date=self.datetime+15)
 
   def stepModifySimulationLineResource(self,sequence=None, sequence_list=None, **kw):
     """
@@ -559,8 +559,8 @@ class TestPackingListMixin(TestOrderMixin):
     simulation_line_list = applied_rule.objectValues()
     resource_list = sequence.get('resource_list')
     for simulation_line in simulation_line_list:
+      simulation_line.recordProperty('resource')
       simulation_line.edit(resource_value=resource_list[-1])
-      simulation_line.getOrderValue().edit(resource_value=resource_list[-1])
 
   def stepModifyOneSimulationLineResource(self,sequence=None, sequence_list=None, **kw):
     """
@@ -569,8 +569,8 @@ class TestPackingListMixin(TestOrderMixin):
     applied_rule = sequence.get('applied_rule')
     simulation_line_list = applied_rule.objectValues()
     resource_list = sequence.get('resource_list')
+    simulation_line_list[-1].recordProperty('resource')
     simulation_line_list[-1].edit(resource_value=resource_list[-1])
-    simulation_line_list[-1].getOrderValue().edit(resource_value=resource_list[-1])
 
   def stepNewPackingListAdoptPrevisionQuantity(self,sequence=None, sequence_list=None, **kw):
     """
-- 
2.30.9