From 54c0071b4ba33a88dcd1d4194e50413a7662d939 Mon Sep 17 00:00:00 2001 From: Kazuhiko Shiozaki <kazuhiko@nexedi.com> Date: Wed, 24 Feb 2010 04:46:30 +0000 Subject: [PATCH] try to find payment condition not from explanation delivery but from delivery link movement, to make it possible to have payment condition for each movement (though not supported for now). git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33074 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/PaymentSimulationRule.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/product/ERP5/Document/PaymentSimulationRule.py b/product/ERP5/Document/PaymentSimulationRule.py index 6d58fd556c..10b44031d4 100644 --- a/product/ERP5/Document/PaymentSimulationRule.py +++ b/product/ERP5/Document/PaymentSimulationRule.py @@ -66,10 +66,14 @@ class PaymentSimulationRule(Rule, PredicateMatrix): payment_conditon_list = [] - # try to find local payment conditions - delivery = input_movement.getDeliveryValue() - if delivery is None: - delivery = input_movement.getExplanationValue() + # try to find local payment conditions from the upper level delivery + rule = applied_rule + movement = input_movement + delivery = movement.getDeliveryValue() + while delivery is None and not(rule.isRootAppliedRule()): + rule = movement.getParentValue() + movement = rule.getParentValue() + delivery = movement.getDeliveryValue() if delivery is not None: payment_condition_list = delivery.getPaymentConditionValueList() -- 2.30.9