brotherton-erpnext/erpnext/patches/v4_0/new_address_template.py
2014-06-09 15:18:45 +05:30

14 lines
398 B
Python

import frappe
def execute():
frappe.reload_doc("utilities", "doctype", "address_template")
if not frappe.db.sql("select name from `tabAddress Template`"):
try:
d = frappe.new_doc("Address Template")
d.update({"country":frappe.db.get_default("country") or
frappe.db.get_value("Global Defaults", "Global Defaults", "country")})
d.insert()
except:
print frappe.get_traceback()