From 3a200bbc447ee05c650bbd592a331b2817c9a498 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 11 Jul 2017 11:34:27 +0530 Subject: [PATCH] Update create_address_doc_from_address_field_in_company.py --- .../v8_0/create_address_doc_from_address_field_in_company.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v8_0/create_address_doc_from_address_field_in_company.py b/erpnext/patches/v8_0/create_address_doc_from_address_field_in_company.py index 822d9f027b..cf1bc5af05 100644 --- a/erpnext/patches/v8_0/create_address_doc_from_address_field_in_company.py +++ b/erpnext/patches/v8_0/create_address_doc_from_address_field_in_company.py @@ -9,7 +9,8 @@ def execute(): # so here is the patch for moving the address details in the address doc company_list = [] if 'address' in frappe.db.get_table_columns('Company'): - company_list = frappe.db.sql('''select name, address from `tabCompany` where address is not null''', as_dict=1) + company_list = frappe.db.sql('''select name, address from `tabCompany` + where address is not null and address != ""''', as_dict=1) for company in company_list: add_list = company.address.split(" ")