brotherton-erpnext/erpnext/patches/v4_0/new_address_template.py
Aditya Hase 6ccb6562f1 Python 3 compatibility syntax error fixes (#10519)
* Use Python 3 style print function

* Use 'Exception as e' instead of 'Exception, e'

* Unpack tuple arguments explicitly in instead of relying on auto unpacking

* Use consistent indentation

* Use 0 if stock_frozen_upto_days is None
2017-08-28 18:17:36 +05:30

15 lines
455 B
Python

from __future__ import print_function, unicode_literals
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())