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

14 lines
398 B
Python
Raw Normal View History

2014-06-05 14:44:16 +05:30
import frappe
def execute():
2014-06-05 17:34:59 +05:30
frappe.reload_doc("utilities", "doctype", "address_template")
2014-06-06 17:07:50 +05:30
if not frappe.db.sql("select name from `tabAddress Template`"):
2014-06-06 17:37:31 +05:30
try:
d = frappe.new_doc("Address Template")
2014-06-09 15:18:45 +05:30
d.update({"country":frappe.db.get_default("country") or
frappe.db.get_value("Global Defaults", "Global Defaults", "country")})
2014-06-06 17:37:31 +05:30
d.insert()
except:
print frappe.get_traceback()