Commit f60f2922 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

use rule's updating testers for getting values instead of getting all possible...

use rule's updating testers for getting values instead of getting all possible properties and categories.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32282 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 78efcb26
......@@ -36,8 +36,8 @@ from Products.ERP5.Document.Predicate import Predicate
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 @@ class InvoiceTransactionRule(RuleMixin, MovementCollectionUpdaterMixin, Predicat
# 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 @@ class InvoiceTransactionRuleMovementGenerator(object):
# 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,
......
......@@ -37,7 +37,6 @@ from Products.ERP5.mixin.rule import RuleMixin
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 @@ class PaymentRuleMovementGenerator(MovementGeneratorMixin):
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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment