From efac56bb5d5b13d97bf8355ffe8002ae59cf65cb 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 --- account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account.py b/account.py index 97d86f8a29..2435d402c4 100644 --- a/account.py +++ b/account.py @@ -1966,7 +1966,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 @@ -2014,7 +2014,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):