fix: Delayed Order Report not working (#41037)

This commit is contained in:
rohitwaghchaure
2024-04-16 17:14:59 +05:30
committed by GitHub
parent 42a5e61ac3
commit d69a18b826

View File

@@ -86,7 +86,11 @@ class DelayedItemReport:
filters = {"parent": ("in", sales_orders), "name": ("in", sales_order_items)}
so_data = {}
for d in frappe.get_all(doctype, filters=filters, fields=["delivery_date", "parent", "name"]):
fields = ["delivery_date", "name"]
if frappe.db.has_column(doctype, "parent"):
fields.append("parent")
for d in frappe.get_all(doctype, filters=filters, fields=fields):
key = d.name if consolidated else (d.parent, d.name)
if key not in so_data:
so_data.setdefault(key, d.delivery_date)