From 3dc722b0964af9ad6fd7b008563636ddd378d914 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 13 Jun 2014 15:30:38 +0530 Subject: [PATCH] Create price list only if setup complete --- erpnext/patches/v4_0/create_price_list_if_missing.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/patches/v4_0/create_price_list_if_missing.py b/erpnext/patches/v4_0/create_price_list_if_missing.py index eeeae19783..eea1fd9ff6 100644 --- a/erpnext/patches/v4_0/create_price_list_if_missing.py +++ b/erpnext/patches/v4_0/create_price_list_if_missing.py @@ -7,6 +7,10 @@ from frappe import _ from frappe.utils.nestedset import get_root_of def execute(): + # setup not complete + if not frappe.db.sql("""select name from tabCompany limit 1"""): + return + if not frappe.db.sql("select name from `tabPrice List` where buying=1"): create_price_list(_("Standard Buying"), buying=1)