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 6e248555f3d..822d9f027b2 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 @@ -5,10 +5,10 @@ from __future__ import unicode_literals import frappe def execute(): - # new field address_html is created in place of address field for the company's address - # patch for moving the address details in the address doc + # new field address_html is created in place of address field for the company's address in PR #8754 (without patch) + # so here is the patch for moving the address details in the address doc company_list = [] - if frappe.db.sql("SHOW COLUMNS FROM `tabCompany` LIKE 'address'"): + 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) for company in company_list: @@ -24,7 +24,6 @@ def execute(): "doctype":"Address", "address_line1": add_list[0], "city": add_list[2], - "is_your_company_address":1, "links": [{ "link_doctype": "Company", "link_name": company.name