2
0
mirror of https://github.com/frappe/frappe.git synced 2024-06-13 00:22:23 +00:00
frappe/frappe/contacts/doctype/address_template/address_template.js
2022-08-04 14:51:01 +05:30

17 lines
498 B
JavaScript

// Copyright (c) 2016, Frappe Technologies and contributors
// For license information, please see license.txt
frappe.ui.form.on("Address Template", {
refresh: function (frm) {
if (frm.is_new() && !frm.doc.template) {
// set default template via js so that it is translated
frappe.call({
method: "frappe.contacts.doctype.address_template.address_template.get_default_address_template",
callback: function (r) {
frm.set_value("template", r.message);
},
});
}
},
});