refactor: combine vouchers from both ignore

(cherry picked from commit 4cc5cd5a71)
This commit is contained in:
ruthra kumar
2024-08-13 10:37:55 +05:30
committed by Mergify
parent 34662e6e3c
commit a9871e379a

View File

@@ -246,7 +246,10 @@ def get_conditions(filters):
as_list=True,
)
if system_generated_cr_dr_journals:
filters.update({"voucher_no_not_in": [x[0] for x in system_generated_cr_dr_journals]})
vouchers_to_ignore = (filters.get("voucher_no_not_in") or []) + [
x[0] for x in system_generated_cr_dr_journals
]
filters.update({"voucher_no_not_in": vouchers_to_ignore})
if filters.get("voucher_no_not_in"):
conditions.append("voucher_no not in %(voucher_no_not_in)s")