mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 13:49:13 +00:00
refactor: convert rfq_transaction_list to query builder (#55497)
This commit is contained in:
@@ -178,16 +178,16 @@ def get_list_for_transactions(
|
|||||||
|
|
||||||
|
|
||||||
def rfq_transaction_list(parties_doctype, doctype, parties, limit_start, limit_page_length):
|
def rfq_transaction_list(parties_doctype, doctype, parties, limit_start, limit_page_length):
|
||||||
data = frappe.db.sql(
|
party = frappe.qb.DocType(parties_doctype)
|
||||||
f"""select distinct parent as name, supplier from `tab{parties_doctype}`
|
data = (
|
||||||
where supplier = %(supplier)s and docstatus=1 order by creation desc limit %(start)s, %(len)s""",
|
frappe.qb.from_(party)
|
||||||
{
|
.select(party.parent.as_("name"), party.supplier)
|
||||||
"supplier": parties[0],
|
.distinct()
|
||||||
"start": cint(limit_start),
|
.where((party.supplier == party[0]) & (party.docstatus == 1))
|
||||||
"len": cint(limit_page_length),
|
.orderby(party.creation, order=frappe.qb.desc)
|
||||||
},
|
.limit(limit_page_length)
|
||||||
as_dict=1,
|
.offset(limit_start)
|
||||||
)
|
).run(as_dict=True)
|
||||||
|
|
||||||
return post_process(doctype, data)
|
return post_process(doctype, data)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user