From b1473c3de0577f00dff9749192a8717a41aefe81 Mon Sep 17 00:00:00 2001 From: 0Pranav Date: Fri, 31 Jan 2020 10:43:00 +0530 Subject: [PATCH] fix: return empty array --- .../report/territory_wise_sales/territory_wise_sales.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/selling/report/territory_wise_sales/territory_wise_sales.py b/erpnext/selling/report/territory_wise_sales/territory_wise_sales.py index c8a63ee29f1..842e6345106 100644 --- a/erpnext/selling/report/territory_wise_sales/territory_wise_sales.py +++ b/erpnext/selling/report/territory_wise_sales/territory_wise_sales.py @@ -58,13 +58,13 @@ def get_data(filters=None): for territory in frappe.get_all("Territory"): territory_opportunities = list(filter(lambda x: x.territory == territory.name, opportunities)) if opportunities and opportunities else [] - t_opportunity_names = [t.name for t in territory_opportunities] if territory_opportunities else None + t_opportunity_names = [t.name for t in territory_opportunities] if territory_opportunities else [] territory_quotations = list(filter(lambda x: x.opportunity in t_opportunity_names, quotations)) if t_opportunity_names and quotations else [] - t_quotation_names = [t.name for t in territory_quotations] if territory_quotations else None + t_quotation_names = [t.name for t in territory_quotations] if territory_quotations else [] territory_orders = list(filter(lambda x: x.quotation in t_quotation_names, sales_orders)) if t_quotation_names and sales_orders else [] - t_order_names = [t.name for t in territory_orders] if territory_orders else None + t_order_names = [t.name for t in territory_orders] if territory_orders else [] territory_invoices = list(filter(lambda x: x.sales_order in t_order_names, sales_invoices)) if t_order_names and sales_invoices else []