From 1505176350e4a4d66ce3c612f68f32a8dd4c0360 Mon Sep 17 00:00:00 2001 From: Kazuhiko Shiozaki <kazuhiko@nexedi.com> Date: Tue, 16 Feb 2010 08:52:53 +0000 Subject: [PATCH] if calculated date is None, do not use it. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32584 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/PaymentRule.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/product/ERP5/Document/PaymentRule.py b/product/ERP5/Document/PaymentRule.py index 6fa9e89396..2348726bb1 100644 --- a/product/ERP5/Document/PaymentRule.py +++ b/product/ERP5/Document/PaymentRule.py @@ -71,8 +71,12 @@ class PaymentRule(Rule): # Since we need to consider business_path only for bank movement, # not for payable movement, we pass None as business_path here. kw = self._getExpandablePropertyDict(applied_rule, input_movement, None) - kw['start_date'] = business_path.getExpectedStartDate(input_movement) - kw['stop_date'] = business_path.getExpectedStopDate(input_movement) + start_date = business_path.getExpectedStartDate(input_movement) + if start_date is not None: + kw['start_date'] = start_date + stop_date = business_path.getExpectedStopDate(input_movement) + if stop_date is not None: + kw['stop_date'] = stop_date quantity = business_path.getExpectedQuantity(input_movement) # one for payable -- 2.30.9