mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
refactor(territory_wise_sales): replace SQL with query builder (#55176)
This commit is contained in:
@@ -133,17 +133,13 @@ def get_quotations(opportunities):
|
|||||||
if not opportunities:
|
if not opportunities:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
opportunity_names = [o.name for o in opportunities]
|
opportunity_names = [o.get("name") for o in opportunities]
|
||||||
|
|
||||||
return frappe.db.sql(
|
return frappe.get_all(
|
||||||
"""
|
"Quotation",
|
||||||
SELECT `name`,`base_grand_total`, `opportunity`
|
fields=["name", "base_grand_total", "opportunity"],
|
||||||
FROM `tabQuotation`
|
filters={"docstatus": 1, "opportunity": ["in", opportunity_names]},
|
||||||
WHERE docstatus=1 AND opportunity in ({})
|
)
|
||||||
""".format(", ".join(["%s"] * len(opportunity_names))),
|
|
||||||
tuple(opportunity_names),
|
|
||||||
as_dict=1,
|
|
||||||
) # nosec
|
|
||||||
|
|
||||||
|
|
||||||
def get_sales_orders(quotations):
|
def get_sales_orders(quotations):
|
||||||
|
|||||||
Reference in New Issue
Block a user