From 3c964a7d51837b40ce0c1112c79f6aeea066f65b Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Wed, 28 Jun 2023 13:41:10 +0200 Subject: [PATCH] fix: exception if no bookings in cashbook used for evaluation --- line.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/line.py b/line.py index d4e4ab4..ca853a5 100644 --- a/line.py +++ b/line.py @@ -154,6 +154,8 @@ class EvaluationLine(ModelSQL, ModelView): Currency = Pool().get('currency.currency') exp = Decimal(Decimal(1) / 10 ** self.currency_digits) + if amount is None: + return Decimal('0.0') return Currency.compute( from_currency, amount,