From feb60a3728e3a81b04f210e28e2fd46eaf2490f0 Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Mon, 23 May 2016 15:10:46 +0200
Subject: [PATCH] amount_generator: AggregatedAmountList -> GeneratedAmountList

---
 product/ERP5/Document/TradeCondition.py                     | 2 +-
 .../{AggregatedAmountList.py => GeneratedAmountList.py}     | 4 ++--
 product/ERP5/mixin/amount_generator.py                      | 6 +++---
 product/ERP5/tests/testApparelTransformation.py             | 4 ++--
 product/ERP5/tests/testERP5Interfaces.py                    | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)
 rename product/ERP5/{AggregatedAmountList.py => GeneratedAmountList.py} (96%)

diff --git a/product/ERP5/Document/TradeCondition.py b/product/ERP5/Document/TradeCondition.py
index e04bae592e..f96501117f 100644
--- a/product/ERP5/Document/TradeCondition.py
+++ b/product/ERP5/Document/TradeCondition.py
@@ -39,7 +39,7 @@ from Products.ERP5Type import Permissions, PropertySheet, interfaces
 from Products.ERP5Type.Utils import deprecated
 from Products.ERP5.mixin.composition import _getEffectiveModel
 from Products.ERP5.Document.Transformation import Transformation
-from Products.ERP5.AggregatedAmountList import AggregatedAmountList
+from Products.ERP5.GeneratedAmountList import GeneratedAmountList
 from Products.ERP5.Document.MappedValue import MappedValue
 from Products.ERP5.mixin.amount_generator import AmountGeneratorMixin
 from Products.ERP5.mixin.variated import VariatedMixin
diff --git a/product/ERP5/AggregatedAmountList.py b/product/ERP5/GeneratedAmountList.py
similarity index 96%
rename from product/ERP5/AggregatedAmountList.py
rename to product/ERP5/GeneratedAmountList.py
index a8c25a6934..fd93dd25a2 100644
--- a/product/ERP5/AggregatedAmountList.py
+++ b/product/ERP5/GeneratedAmountList.py
@@ -31,7 +31,7 @@ import zope.interface
 from AccessControl import allow_class
 from Products.ERP5Type import interfaces
 
-class AggregatedAmountList(list):
+class GeneratedAmountList(list):
   """
     Temporary object needed to aggregate Amount value
     And to calculate some report or total value
@@ -60,4 +60,4 @@ class AggregatedAmountList(list):
         result += duration
     return result
 
-allow_class(AggregatedAmountList)
+allow_class(GeneratedAmountList)
diff --git a/product/ERP5/mixin/amount_generator.py b/product/ERP5/mixin/amount_generator.py
index d076656aa5..0c73c9980e 100644
--- a/product/ERP5/mixin/amount_generator.py
+++ b/product/ERP5/mixin/amount_generator.py
@@ -32,7 +32,7 @@ import zope.interface
 from AccessControl import ClassSecurityInfo
 from Products.ERP5Type.Globals import InitializeClass
 from Acquisition import aq_base, Implicit
-from Products.ERP5.AggregatedAmountList import AggregatedAmountList
+from Products.ERP5.GeneratedAmountList import GeneratedAmountList
 from Products.ERP5Type import Permissions, interfaces
 from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
 from Products.ERP5.Document.MappedValue import MappedValue
@@ -281,7 +281,7 @@ class AmountGeneratorMixin:
       portal.getPortalAmountGeneratorCellTypeList()
 
     # Set empty result by default
-    result = AggregatedAmountList()
+    result = GeneratedAmountList()
 
     args = (getTransactionalVariable().setdefault(
               "amount_generator.BaseAmountDict", {}),
@@ -517,7 +517,7 @@ class AmountGeneratorMixin:
     # XXX: Do we handle rounding correctly ?
     #      What to do if only total price is rounded ??
     aggregate_dict = {}
-    result_list = AggregatedAmountList()
+    result_list = GeneratedAmountList()
     for amount in generated_amount_list:
       key = (amount.getPrice(), amount.getEfficiency(),
              amount.getReference(), amount.categories)
diff --git a/product/ERP5/tests/testApparelTransformation.py b/product/ERP5/tests/testApparelTransformation.py
index d4687a65ec..e88ef10c15 100644
--- a/product/ERP5/tests/testApparelTransformation.py
+++ b/product/ERP5/tests/testApparelTransformation.py
@@ -529,7 +529,7 @@ class TestApparelTransformation(TestOrderMixin, ERP5TypeTestCase):
 
   def stepVerifySpecialisedTransformationAggregatedAmountList(self, sequence=None, sequence_list=None, **kw):
     """
-      Verify the return of AggregatedAmountList for a transformation which includes another one
+      Verify the return of GeneratedAmountList for a transformation which includes another one
     """
     expected_list = [
       {'id':('size/Baby', 'colour/apparel_model_module/1/1', 'morphology/apparel_model_module/1/4'),
@@ -672,7 +672,7 @@ class TestApparelTransformation(TestOrderMixin, ERP5TypeTestCase):
 
       # Check global quantity
       total_price = aggregated_amount_list.getTotalPrice()
-      error_msg = 'Total price for AggregatedAmountList differs between ' \
+      error_msg = 'Total price for GeneratedAmountList differs between ' \
                   'expected (%s) and aggregated (%s) (%s)' % \
                   (total_price, expected['total'], expected['id'])
       self.assertEqual(round(total_price, 10), round(expected['total'], 10),
diff --git a/product/ERP5/tests/testERP5Interfaces.py b/product/ERP5/tests/testERP5Interfaces.py
index c7a4d73c5b..98e8ecff21 100644
--- a/product/ERP5/tests/testERP5Interfaces.py
+++ b/product/ERP5/tests/testERP5Interfaces.py
@@ -55,7 +55,7 @@ implements_tuple_list = [
   (('Products.ERP5.Document.EmailDocument', 'EmailDocument'), 'IDocument'),
   (('Products.ERP5.Document.Event', 'Event'), 'IDocument'),
   # IAmountList
-  (('Products.ERP5.AggregatedAmountList', 'AggregatedAmountList'), 'IAmountList'),
+  (('Products.ERP5.GeneratedAmountList', 'GeneratedAmountList'), 'IAmountList'),
 ]
 # IMovementGroup
 for movement_group_class_name in ['MovementGroup', 'BaseVariantMovementGroup',
-- 
2.30.9