mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-17 08:28:44 +00:00
fix(postgres): aggregate bare account in pos_closing payments; explicit limit on gl-entry fetch
Address review (#56111): - pos_closing get_payments grouped by mode_of_payment but selected a bare account -> Postgres GroupingError. Wrap in Max() (deterministic, both engines agree; account is consumed downstream for the change-amount adjustment). test_pos_closing_entry 9/9 both engines. - get_voucherwise_gl_entries: add limit=0 to make the unbounded fetch explicit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -295,7 +295,7 @@ def get_payments(invoices):
|
||||
.groupby(SalesInvoicePayment.mode_of_payment)
|
||||
.select(
|
||||
SalesInvoicePayment.mode_of_payment,
|
||||
SalesInvoicePayment.account.as_("account"),
|
||||
fn.Max(SalesInvoicePayment.account).as_("account"),
|
||||
fn.Sum(SalesInvoicePayment.amount).as_("amount"),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1835,6 +1835,7 @@ def get_voucherwise_gl_entries(future_stock_vouchers, posting_date):
|
||||
"GL Entry",
|
||||
filters={"posting_date": [">=", posting_date], "voucher_no": ["in", voucher_nos]},
|
||||
fields=["name", "account", "credit", "debit", "cost_center", "project", "voucher_type", "voucher_no"],
|
||||
limit=0,
|
||||
)
|
||||
|
||||
for d in gles:
|
||||
|
||||
Reference in New Issue
Block a user