[patch] map customer_address to shipping_address and customer_address_display to shipping_address_display

This commit is contained in:
Saurabh 2016-03-15 16:01:55 +05:30 committed by Nabin Hait
parent 14d646f636
commit 0f063a5f46
2 changed files with 20 additions and 0 deletions

View File

@ -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

View File

@ -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()