From 3942cd353ab32ae3f175937124ff1814363e2f86 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Tue, 19 Dec 2017 12:48:27 +0530 Subject: [PATCH] create item price only if item created, fixes #12041 --- erpnext/utilities/user_progress_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/utilities/user_progress_utils.py b/erpnext/utilities/user_progress_utils.py index 08dd7efe19..9d5c25879d 100644 --- a/erpnext/utilities/user_progress_utils.py +++ b/erpnext/utilities/user_progress_utils.py @@ -113,6 +113,9 @@ def create_items(args_data): "default_warehouse": default_warehouse }).insert() + except frappe.NameError: + pass + else: if args.get("item_price_" + str(i)): item_price = flt(args.get("item_price_" + str(i))) @@ -121,8 +124,6 @@ def create_items(args_data): price_list_name = frappe.db.get_value("Price List", {"buying": 1}) make_item_price(item, price_list_name, item_price) - except frappe.NameError: - pass def make_item_price(item, price_list_name, item_price): frappe.get_doc({