How add custom script in chart of account?

I want to add custom script while new Account to set account number based on custom sequence.

How can I do that?

I solve this by adding this line in hooks:

doctype_tree_js = {"Account": "public/js/account_tree.js"}

but I want to trigger some event on account name but it is not working:

frappe.provide("frappe.treeview_settings")

 $.extend(frappe.treeview_settings["Account"], {
	onload: function() {
    console.log("This is onload");
	},
  account_name:function() {
    console.log("This is account_name");
	}
});
3 Likes