Extend erpnext public js funtion
Templating in ERPNext:
2) other app`s public js.
3) add you file path in your app build.json
4) bench build
$.extend(erpnext.utils, {
render_address_and_contact: function(frm) {
// render address
$(frm.fields_dict['address_htm l'].wrapper)
.html(frappe.render_template(" address_list",
cur_frm.doc.__onload))
.find(".btn-address").on("clic k", function() {
frappe.new_doc("Address");
});
// render contact
if(frm.fields_dict['contact_ht ml']) {
$(frm.fields_dict['contact_htm l'].wrapper)
.html(frappe.render_template(" contact_list",
cur_frm.doc.__onload))
.find(".btn-contact").on("clic k", function() {
frappe.new_doc("Contact");
}
);
console.log("my file trigger")
}
}
Love your Blog. Your ERPNext examples are really easy to understand and concise. Thanks so much.
ReplyDelete