From 0f063a5f467d859b9757ed68f15de61d9ce122ef Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 15 Mar 2016 16:01:55 +0530 Subject: [PATCH] [patch] map customer_address to shipping_address and customer_address_display to shipping_address_display --- erpnext/patches.txt | 1 + ...tomer_address_to_shipping_address_on_po.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 erpnext/patches/v6_24/map_customer_address_to_shipping_address_on_po.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 8872ca90a5..43ec83dbde 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -256,3 +256,4 @@ erpnext.patches.v6_24.set_recurring_id erpnext.patches.v6_20x.set_compact_print execute:frappe.delete_doc_if_exists("Web Form", "contact") #2016-03-10 erpnext.patches.v6_20x.remove_fiscal_year_from_holiday_list +erpnext.patches.v6_24.map_customer_address_to_shipping_address_on_po \ No newline at end of file diff --git a/erpnext/patches/v6_24/map_customer_address_to_shipping_address_on_po.py b/erpnext/patches/v6_24/map_customer_address_to_shipping_address_on_po.py new file mode 100644 index 0000000000..1dd8083c7c --- /dev/null +++ b/erpnext/patches/v6_24/map_customer_address_to_shipping_address_on_po.py @@ -0,0 +1,19 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + frappe.reload_doctype("Purchase Order") + + if not frappe.db.has_column("Purchase Order", "shipping_address"): + return + + if not frappe.db.has_column("Purchase Order", "customer_address"): + return + + frappe.db.sql("""update `tabPurchase Order` set shipping_address=customer_address, + shipping_address_display=customer_address_display""") + + frappe.db.commit() \ No newline at end of file