2015-02-24 12:24:53 +05:30
|
|
|
from __future__ import unicode_literals
|
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()
|
|
|
|
|