[Erp5-report] r32282 kazuhiko - /erp5/trunk/bt5/erp5_simulation/DocumentTemplateItem/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Feb 5 10:29:50 CET 2010


Author: kazuhiko
Date: Fri Feb  5 10:29:50 2010
New Revision: 32282

URL: http://svn.erp5.org?rev=32282&view=rev
Log:
use rule's updating testers for getting values instead of getting all possible properties and categories.

Modified:
    erp5/trunk/bt5/erp5_simulation/DocumentTemplateItem/InvoiceTransactionRule.py
    erp5/trunk/bt5/erp5_simulation/DocumentTemplateItem/PaymentRule.py

Modified: erp5/trunk/bt5/erp5_simulation/DocumentTemplateItem/InvoiceTransactionRule.py
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_simulation/DocumentTemplateItem/InvoiceTransactionRule.py?rev=32282&r1=32281&r2=32282&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_simulation/DocumentTemplateItem/InvoiceTransactionRule.py [utf8] (original)
+++ erp5/trunk/bt5/erp5_simulation/DocumentTemplateItem/InvoiceTransactionRule.py [utf8] Fri Feb  5 10:29:50 2010
@@ -36,8 +36,8 @@
 from Products.ERP5.mixin.rule import RuleMixin
 from Products.ERP5.mixin.movement_collection_updater import \
      MovementCollectionUpdaterMixin
-from Products.ERP5.MovementCollectionDiff import _getPropertyAndCategoryList
 from Products.ERP5.Document.PredicateMatrix import PredicateMatrix
+from Products.ERP5.mixin.movement_generator import MovementGeneratorMixin
 
 class InvoiceTransactionRule(RuleMixin, MovementCollectionUpdaterMixin, Predicate, PredicateMatrix):
   """
@@ -95,7 +95,7 @@
     # or destination.
     return (movement.getSource() is None or movement.getDestination() is None)
 
-class InvoiceTransactionRuleMovementGenerator(object):
+class InvoiceTransactionRuleMovementGenerator(MovementGeneratorMixin):
   def getGeneratedMovementList(self, context, movement_list=None,
                                 rounding=False):
     """
@@ -153,7 +153,8 @@
           # last resort : get the resource from the rule
           resource = accounting_rule_cell_line.getResource() \
               or cell.getResource()
-        kw = _getPropertyAndCategoryList(input_movement)
+        # XXX we need business path here?
+        kw = self._getPropertyAndCategoryList(input_movement, None, rule)
 
         kw.update(
           delivery=None,

Modified: erp5/trunk/bt5/erp5_simulation/DocumentTemplateItem/PaymentRule.py
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_simulation/DocumentTemplateItem/PaymentRule.py?rev=32282&r1=32281&r2=32282&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_simulation/DocumentTemplateItem/PaymentRule.py [utf8] (original)
+++ erp5/trunk/bt5/erp5_simulation/DocumentTemplateItem/PaymentRule.py [utf8] Fri Feb  5 10:29:50 2010
@@ -37,7 +37,6 @@
 from Products.ERP5.mixin.movement_collection_updater import \
      MovementCollectionUpdaterMixin
 from Products.ERP5.mixin.movement_generator import MovementGeneratorMixin
-from Products.ERP5.MovementCollectionDiff import _getPropertyAndCategoryList
 
 class PaymentRule(RuleMixin, MovementCollectionUpdaterMixin, Predicate):
   """
@@ -102,12 +101,14 @@
     XXX This implementation using Business Path, not Payment Condition.
     """
     ret = []
+    rule = context.getSpecialiseValue()
     for input_movement, business_path in self \
             ._getInputMovementAndPathTupleList(context):
       # Payment Rule does not work with Business Path
       if business_path is None:
         continue
-      kw = _getPropertyAndCategoryList(input_movement)
+      kw = self._getPropertyAndCategoryList(input_movement, business_path,
+                                            rule)
       kw.update({'order':None, 'delivery':None})
       quantity = kw.pop('quantity', 0)
       efficiency = business_path.getEfficiency()




More information about the Erp5-report mailing list