From 81796aafe33fbf1d8feb8cea2834df6280c9d4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 23 May 2008 11:05:30 +0200 Subject: [PATCH] Don't raise exception for empty payment line with no remainder --- invoice.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/invoice.py b/invoice.py index 0c7320da6f..410cc101fd 100644 --- a/invoice.py +++ b/invoice.py @@ -59,7 +59,10 @@ class PaymentTerm(OSV): context) value_date = delay_obj.get_date(cursor, user, line, date, context) if not value or not value_date: - raise ExceptORM('Error', 'Invalid payment term line!') + if not remainder: + raise ExceptORM('Error', 'Invalid payment term line!') + else: + continue res.append((value_date, value)) remainder -= value if not currency_obj.is_zero(cursor, user, currency, remainder):