From b434d48cf12dbeccd315f458383993cd308bcc88 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Mon, 20 Mar 2023 13:35:10 +0100 Subject: [PATCH] When close stament, set start_balance to 0 in case is none #157628 --- statement.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/statement.py b/statement.py index 4130150..f93208f 100644 --- a/statement.py +++ b/statement.py @@ -243,6 +243,8 @@ class CloseStatement(Wizard): for journal in device.journals: statement = draft_statements.get(journal) if statement and statement.state == 'draft': + if not statement.start_balance: + statement.start_balance = Decimal(0) end_balance = statement.start_balance for line in statement.lines: end_balance += line.amount