mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 21:29:11 +00:00
* refactor: convert rfq_transaction_list to query builder (#55497)
(cherry picked from commit 9cecf2e6f9)
# Conflicts:
# erpnext/controllers/website_list_for_contact.py
* chore: resolve conflicts
---------
Co-authored-by: Shllokkk <140623894+Shllokkk@users.noreply.github.com>
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
This commit is contained in:
@@ -178,13 +178,16 @@ def get_list_for_transactions(
|
||||
|
||||
|
||||
def rfq_transaction_list(parties_doctype, doctype, parties, limit_start, limit_page_length):
|
||||
data = frappe.db.sql(
|
||||
"""select distinct parent as name, supplier from `tab{doctype}`
|
||||
where supplier = '{supplier}' and docstatus=1 order by modified desc limit {start}, {len}""".format(
|
||||
doctype=parties_doctype, supplier=parties[0], start=limit_start, len=limit_page_length
|
||||
),
|
||||
as_dict=1,
|
||||
)
|
||||
party = frappe.qb.DocType(parties_doctype)
|
||||
data = (
|
||||
frappe.qb.from_(party)
|
||||
.select(party.parent.as_("name"), party.supplier)
|
||||
.distinct()
|
||||
.where((party.supplier == party[0]) & (party.docstatus == 1))
|
||||
.orderby(party.creation, order=frappe.qb.desc)
|
||||
.limit(limit_page_length)
|
||||
.offset(limit_start)
|
||||
).run(as_dict=True)
|
||||
|
||||
return post_process(doctype, data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user