added patch for address

This commit is contained in:
Rushabh Mehta 2014-02-28 11:37:36 +05:30
parent fb21ce3893
commit 063141d152
2 changed files with 13 additions and 0 deletions

View File

@ -21,3 +21,4 @@ execute:frappe.reload_doc('hr', 'doctype', 'employee') # 2014-02-03
execute:frappe.db.sql("update tabPage set module='Core' where name='Setup'")
erpnext.patches.4_0.fields_to_be_renamed
erpnext.patches.4_0.rename_sitemap_to_route
erpnext.patches.4_0.fix_contact_address

View File

@ -0,0 +1,12 @@
import frappe
def execute():
frappe.reload_doc("website", "doctype", "contact_us_settings")
address = frappe.db.get_value("Contact Us Settings", None, "address")
if address:
address = frappe.doc("Address", address)
contact = frappe.bean("Contact Us Settings", "Contact Us Settings")
for f in ("address_title", "address_line1", "address_line2", "city", "state", "country", "pincode"):
contact.doc.fields[f] = address.get(f)
contact.save()