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)
(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):
|
def rfq_transaction_list(parties_doctype, doctype, parties, limit_start, limit_page_length):
|
||||||
data = frappe.db.sql(
|
party = frappe.qb.DocType(parties_doctype)
|
||||||
"""select distinct parent as name, supplier from `tab{doctype}`
|
data = (
|
||||||
where supplier = '{supplier}' and docstatus=1 order by modified desc limit {start}, {len}""".format(
|
frappe.qb.from_(party)
|
||||||
doctype=parties_doctype, supplier=parties[0], start=limit_start, len=limit_page_length
|
.select(party.parent.as_("name"), party.supplier)
|
||||||
),
|
.distinct()
|
||||||
as_dict=1,
|
.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)
|
return post_process(doctype, data)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user