Do not compare debit or credit to None when searching

issue11568
review417441003
This commit is contained in:
Adrià Tarroja Caubet
2022-06-24 09:19:13 +02:00
parent 43d4522bbb
commit efac56bb5d
+2 -2
View File
@@ -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):