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))