From f574121741800425e9eb8b34a78e26d8ed1d877a Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 25 Apr 2022 15:05:10 +0530 Subject: [PATCH] refactor: simpler check for non-SO items --- erpnext/stock/doctype/pick_list/pick_list.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index a94745677f5e..9daf4f11c40e 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -517,13 +517,7 @@ def create_delivery_note(source_name, target_doc=None): if sales_dict: delivery_note = create_dn_with_so(sales_dict, pick_list) - is_item_wo_so = 0 - for location in pick_list.locations: - if not location.sales_order: - is_item_wo_so = 1 - break - if is_item_wo_so == 1: - # Create a DN for items without sales orders as well + if not all(item.sales_order for item in pick_list.locations): delivery_note = create_dn_wo_so(pick_list) frappe.msgprint(_("Delivery Note(s) created for the Pick List"))