Javascript views and Customization


To give a concrete example:

In my case i need to create an object of frappe.views.CommunicationComposer. But i don’t want to call
frappe.core.doctype.communication.communication.make i want to call my custom server make…

I only need to change the method to call. But to don’t break future releases i copy all the class to my own javascript file and i change the method to call my custom server method.

There is no need to duplicate code when the fixe is only to passe the method in options to frappe.views.CommunicationComposer(opts) and to change{
			method: me.method || "frappe.core.doctype.communication.communication.make",

The same problem is with the filed fields in method make of the same class we can pass the fields in opts when we create the class and change fields: me.cfields || [...]

So, can i suggest a Pull Request to this and other javascript views?


Note: i don’t want to override whitelist method because i need to send more arguments than the arguments sended by the communicationcomposer object. So, i also need to customize the args that are sended.

Sure - please feel free to send the pull request.