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 822d9f027b2..cf1bc5af057 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(" ")