From b6111f07070e69a4dc66a6e4e4f32b3c39582cc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Wed, 5 Aug 2020 09:36:09 +0800 Subject: [PATCH] Fixed the find_order_holes() utility so that pseudo records does not count in the accounting application. --- accounting/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/accounting/utils.py b/accounting/utils.py index 66ae258..618260d 100644 --- a/accounting/utils.py +++ b/accounting/utils.py @@ -320,7 +320,8 @@ def find_order_holes(records): .annotate(count=Count("pk")) .filter(~Q(count=1))] for record in records: - record.has_order_hole = record.transaction.date in holes + record.has_order_hole = record.pk is not None\ + and record.transaction.date in holes def get_summary_categories():