brotherton-erpnext/erpnext/patches/v4_0/fix_contact_address.py

12 lines
454 B
Python
Raw Normal View History

2014-02-28 06:07:36 +00:00
import frappe
def execute():
frappe.reload_doc("website", "doctype", "contact_us_settings")
address = frappe.db.get_value("Contact Us Settings", None, "address")
if address:
2014-03-28 11:14:37 +00:00
address = frappe.get_doc("Address", address)
contact = frappe.get_doc("Contact Us Settings", "Contact Us Settings")
2014-02-28 06:07:36 +00:00
for f in ("address_title", "address_line1", "address_line2", "city", "state", "country", "pincode"):
contact.set(f, address.get(f))
2014-02-28 06:07:36 +00:00
contact.save()