From 950025486135b0ecb1c95244376bf00a953d735f Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sun, 14 Jan 2024 11:25:58 +0530 Subject: [PATCH] Revert "chore: orderby in gle" This reverts commit 005c5a587ff7322a6f3fb1099aa0c94e6873c7fe. --- .../purchase_receipt/test_purchase_receipt.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index ce88dd9e44..57ba5bb0a5 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -4,7 +4,6 @@ import frappe from frappe.tests.utils import FrappeTestCase, change_settings from frappe.utils import add_days, cint, cstr, flt, nowtime, today -from pypika import Order from pypika import functions as fn import erpnext @@ -2254,13 +2253,13 @@ def get_sl_entries(voucher_type, voucher_no): def get_gl_entries(voucher_type, voucher_no): - gle = frappe.qb.DocType("GL Entry") - return ( - frappe.qb.from_(gle) - .select(gle.account, gle.debit, gle.credit, gle.cost_center, gle.is_cancelled) - .where((gle.voucher_type == voucher_type) & (gle.voucher_no == voucher_no)) - .orderby(gle.account, gle.debit, order=Order.desc) - ).run(as_dict=True) + return frappe.db.sql( + """select account, debit, credit, cost_center, is_cancelled + from `tabGL Entry` where voucher_type=%s and voucher_no=%s + order by account desc""", + (voucher_type, voucher_no), + as_dict=1, + ) def get_taxes(**args):