diff --git a/erpnext/stock/doctype/price_list/price_list.js b/erpnext/stock/doctype/price_list/price_list.js index 23ac6fd7a9f..c362b5a765c 100644 --- a/erpnext/stock/doctype/price_list/price_list.js +++ b/erpnext/stock/doctype/price_list/price_list.js @@ -1,13 +1,14 @@ // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -$.extend(cur_frm.cscript, { - refresh: function() { - cur_frm.add_custom_button(__("Add / Edit Prices"), function() { +frappe.ui.form.on("Price List", { + refresh: function(frm) { + let me = this; + frm.add_custom_button(__("Add / Edit Prices"), function() { frappe.route_options = { - "price_list": cur_frm.doc.name + "price_list": frm.doc.name }; frappe.set_route("Report", "Item Price"); }, "fa fa-money"); } -}); +}); \ No newline at end of file