Do not compare debit or credit to None when searching

issue11568
review417441003
(grafted from 6d06c13574dddb21e36970afd27ea674ddaf4de6)

--HG--
branch : 6.0
This commit is contained in:
Adrià Tarroja Caubet committed 2022-06-24 09:19:13 +02:00
1 parent 40cad4dacb
commit fe5f4963c0
1 file changed
+2 -2
+2 -2
View File
@@ -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):