diff --git a/frappe/contacts/doctype/address_template/address_template.py b/frappe/contacts/doctype/address_template/address_template.py index 9336f75027..2ca9aebff5 100644 --- a/frappe/contacts/doctype/address_template/address_template.py +++ b/frappe/contacts/doctype/address_template/address_template.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document +from frappe.utils import cint from frappe.utils.jinja import validate_template from frappe import _ @@ -17,7 +18,8 @@ class AddressTemplate(Document): if not self.is_default: if not self.defaults: self.is_default = 1 - frappe.msgprint(_("Setting this Address Template as default as there is no other default")) + if cint(frappe.db.get_single_value('System Settings', 'setup_complete')): + frappe.msgprint(_("Setting this Address Template as default as there is no other default")) validate_template(self.template)