mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 07:02:54 +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:
|
||||
return []
|
||||
|
||||
opportunity_names = [o.name for o in opportunities]
|
||||
opportunity_names = [o.get("name") for o in opportunities]
|
||||
|
||||
return frappe.db.sql(
|
||||
"""
|
||||
SELECT `name`,`base_grand_total`, `opportunity`
|
||||
FROM `tabQuotation`
|
||||
WHERE docstatus=1 AND opportunity in ({})
|
||||
""".format(", ".join(["%s"] * len(opportunity_names))),
|
||||
tuple(opportunity_names),
|
||||
as_dict=1,
|
||||
) # nosec
|
||||
return frappe.get_all(
|
||||
"Quotation",
|
||||
fields=["name", "base_grand_total", "opportunity"],
|
||||
filters={"docstatus": 1, "opportunity": ["in", opportunity_names]},
|
||||
)
|
||||
|
||||
|
||||
def get_sales_orders(quotations):
|
||||
|
||||
Reference in New Issue
Block a user