From b81d5fc0f42d37aa70b97926518a2664b9e8bc3a Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Tue, 11 Oct 2022 11:08:23 +0200 Subject: [PATCH] =?UTF-8?q?book:=20berechnung=20des=20saldo=20gefixt,=20fe?= =?UTF-8?q?hler=20bei=20ung=C3=BCltigem=20'date'=20im=20context?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/book.py b/book.py index bbeb106..53e1d56 100644 --- a/book.py +++ b/book.py @@ -289,8 +289,12 @@ class Book(tree(separator='/'), Workflow, ModelSQL, ModelView): ], query=True)), ] if date_limit == True: + dt1 = context.get('date', None) + dt2 = IrDate.today() + if not isinstance(dt1, type(dt2)): + dt1 = dt2 query.append( - ('date', '<=', context.get('date', IrDate.today())) + ('date', '<=', dt1) ) line_query = Line.search(query, query=True)