From 6dc2e43dd63e94d01a333b9eea01ce9999d6042b Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 17 Jun 2026 14:05:50 +0530 Subject: [PATCH] fix(postgres): satisfy strict GROUP BY in process period closing voucher Co-Authored-By: Claude Opus 4.8 (1M context) --- .../process_period_closing_voucher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.py b/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.py index 801c895f37c..24c8c92c7e8 100644 --- a/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.py +++ b/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.py @@ -553,7 +553,8 @@ def process_individual_date(docname: str, date, report_type, parentfield): Sum(gle.credit).as_("credit"), Sum(gle.debit_in_account_currency).as_("debit_in_account_currency"), Sum(gle.credit_in_account_currency).as_("credit_in_account_currency"), - gle.account_currency, + # account_currency is constant per grouped account -> Max() keeps the GROUP BY postgres-valid + Max(gle.account_currency).as_("account_currency"), ).where( (gle.company.eq(company)) & (gle.is_cancelled.eq(0))