From c0da8f11f77c6d3bcd543e70aea6a9754427538e Mon Sep 17 00:00:00 2001 From: ljain112 Date: Fri, 11 Oct 2024 11:07:19 +0530 Subject: [PATCH] fix: added parentheses for correct query formation for logical OR condition --- .../period_closing_voucher/period_closing_voucher.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py index c68cd2925239..f5619f8088fc 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py @@ -353,9 +353,10 @@ def get_balances_based_on_dimensions( 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(