fix: added parentheses for correct query formation for logical OR condition

(cherry picked from commit c0da8f11f7)
This commit is contained in:
ljain112
2024-10-11 11:07:19 +05:30
committed by Mergify
parent 8701cb73ef
commit 0f738de5e5

View File

@@ -323,9 +323,10 @@ class PeriodClosingVoucher(AccountsController):
if get_opening_entries:
query = query.where(
gl_entry.posting_date.between(self.get("year_start_date"), self.posting_date)
| gl_entry.is_opening
== "Yes"
( # noqa: UP034
(gl_entry.posting_date.between(self.get("year_start_date"), self.posting_date))
| (gl_entry.is_opening == "Yes")
)
)
else:
query = query.where(