From fe5f4963c05b9cc3c347e73b2bd6a74101255f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Tarroja=20Caubet?= Date: Fri, 24 Jun 2022 09:19:13 +0200 Subject: [PATCH] Do not compare debit or credit to None when searching issue11568 review417441003 (grafted from 6d06c13574dddb21e36970afd27ea674ddaf4de6) --HG-- branch : 6.0 --- account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account.py b/account.py index c06ccddf3e..369bb6604b 100644 --- a/account.py +++ b/account.py @@ -1832,7 +1832,7 @@ class _GeneralLedgerAccount(ActivePeriodMixin, ModelSQL, ModelView): break ids = [a.id for a in accounts - if operator_(getattr(a, fname), operand)] + if operand is not None and operator_(getattr(a, fname), operand)] return [('id', 'in', ids)] @classmethod @@ -1880,7 +1880,7 @@ class _GeneralLedgerAccount(ActivePeriodMixin, ModelSQL, ModelView): }.get(operator_, lambda v, l: False) ids = [a.id for a in accounts - if operator_(getattr(a, name), operand)] + if operand is not None and operator_(getattr(a, name), operand)] return [('id', 'in', ids)] def get_currency(self, name):